From Eclipse to Emacs: Drupal development with Subversion, tags, templates, and xdebug
| drupal, emacsYesterday, I started working on my Drupal project in Emacs. I can’t believe I hadn’t moved to Emacs earlier. =)
I really like being able to diff a file with C-x v = (vc-diff) and check in a file with C-x v v (vc-next-action). I also like the way that svn-status (from psvn.el) lets me examine a directory tree, mark a set of files, and commit them–all without using the mouse. I probably should’ve set up keyboard shortcuts for these in Eclipse, but Eclipse made it too easy to just use the mouse. Emacs encourages you to use the keyboard, and it’s easy to customize any keyboard shortcut.
php-mode’s C-c . (php-show-arglist) works beautifully with the TAGS file that I’d set up using Exuberant Ctags, so I don’t need to do anything special in order to get function definitions. Definition functions for PHP functions would be nice. In the meantime, there’s C-c C-f (php-search-documentation).
The yasnippet template engine came in handy when I was writing test cases. I updated my module template to include the simpletest hook, added a test case template, and added a template for the simpletest hook as well. Yay dynamic templates!
And I just got Xdebug working with PhpMode and Geben… Sweet!
7 comments
Chris Aniszczyk
2008-07-29T15:12:14ZYou know that Eclipse ships with Emacs keybindings by default, they are actually pretty good.
Each to their own I guess ;)
sean
2008-07-29T16:42:09ZChris -- do you mean these?
http://eclipse-tools.source...
They look half-ass to me, e.g. no rectangle or register commands, C-x k doesn't take a buffer name, etc. The problem is that Eclipse lacks Emacs *features*.
John Fiala
2008-07-29T17:57:38ZIs there a good, easy to follow for the n00b guide for setting up emacs so it does PHP and subversion well? I've used emacs at times for various text file editing, but I'm not familiar with setting it up to do anything more complicated...
seth
2008-07-29T19:26:20ZWhy are you using psvn.el for examining a directory when there's vc-dired (C-x v d).
Just curious....
Torstein Krause Johansen
2008-08-06T11:54:01ZHi there,
great story! I assume you've also gotten a speed boost using Emacs rather than Eclipse? That's one of the reason I use Emacs and not IDEA, it's so much faster to work with. Even the input buffer is way slower in the big IDEs; I didn't learn to write fast just to wait for the IDE to catch up :-)
-Torstein
walkah
2008-08-07T13:55:41ZSo, sacha - you've got me tempted to move back to emacs "full-time" from Komodo... your articles are *awesome*.
Just a quick note, I was having trouble with psvn.el failing to update. I tracked it down to the fact that it calls --non-interactive which apparently fails (for https authentication) on svn 1.5.1. I've ended up just patching out the --non-interactive part for now.
Man, I forgot how much I liked VCS / psvn ...
Keep up the awesome posts!
WuPac
2009-02-10T13:49:47ZHi,
Could you point us to any instructions on how to set Emacs up for PHP/Drupal with XDebug?
Thanks,
Pac