6098 comments
2357 subscribers
6263 on Twitter
Subscribe! Feed reader E-mail

From Eclipse to Emacs: Drupal development with Subversion, tags, templates, and xdebug

Yesterday, 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!

Short URL: http://sachachua.com/blog/p/5007
  • http://mea-bloga.blogspot.com Chris Aniszczyk

    You know that Eclipse ships with Emacs keybindings by default, they are actually pretty good.

    Each to their own I guess ;)

  • sean

    Chris — do you mean these?

    http://eclipse-tools.sourceforge.net/EclipseEmacsKeybindings_3_1.pdf

    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

    Is 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…

  • http://www.sethmason.com seth

    Why are you using psvn.el for examining a directory when there’s vc-dired (C-x v d).

    Just curious….

  • Pingback: An update Java development environment - credmp

  • http://skybert.nu Torstein Krause Johansen

    Hi 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

  • http://walkah.net/ James Walker

    So, 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

    Hi,

    Could you point us to any instructions on how to set Emacs up for PHP/Drupal with XDebug?

    Thanks,

    Pac

On This Day...

  • 2012: 524 wontons — We spent the afternoon making a quadruple batch of Jamie Oliver’s shrimp wonton recipe with way more garlic, sesame oil, [...]
  • 2012: Tablet adventures: Using my TF700 as a second monitor with AirDisplay — UPDATE 2012-07-29: Hmm, I’m getting some weird mouse behaviour after disconnecting from AirDisplay. I’ll look into this some more tomorrow. Multiple [...]
  • 2011: Long weekend ahead — The long-weekend fairy has snuck up on me again. (Don’t you just love it when that happens?) I’m tempted to [...]
  • 2010: A philosophy of sharing and a truth about teaching — SCHEDULED: 2010-07-29 Thu 08:00 /Neal Schaffer thanked me for teaching him the zen of Slideshare. He confessed that [...]
  • 2009: Laptop hard disk still dead — My laptop hard disk is still dead, but I’m surviving.
  • 2009: Unstructured time — The first thread: Paul Graham described the difference between makers’ schedules and managers’ schedules as the difference between needing long [...]
  • 2008: Development kaizen: Deployment and testing — I got back yesterday to a still-empty defect list, so I decided to spend the day working on some infrastructure [...]
  • 2007: GTD in Emacs — credmp has an excellent blog post on GTD with Emacs using Planner and Remember. I’m so happy! =) Random Emacs symbol: [...]
  • 2007: Croissants and tea — Freshly-baked home-made croissants filled with marzipan and sprinkled with slivered almonds. Check. English Breakfast tea. Check. Are there any better ways to start [...]
  • 2007: Weekly review: July 23 to July 29 — Goals from last week: Goals last week This week Finish and print thesis draft In progress. Up to the tenth revision of my paper. [...]
  • 2006: Simon — How can I give you a better sense of the person whom I like? Perhaps by thinking out loud, I’ll be [...]
  • 2005: Blast from the past — If you want to know what I’ve been up to all this while, check out 2004, 2003, 2002, 2001. <laugh> planner-notes-index.el does [...]
  • 2005: More about credit cards — Chargecards.ca has the goods on credit cards in Canada. Check out the list of student-friendly credit cards for no-fee low-minimum-income [...]
  • 2004: Great hackers — A new Paul Graham essay! As always, quite cool. Great Hackers
  • 2004: Clair Ching’s blog — http://www.livejournal.com/users/eclair/
  • 2004: “While Rome Burns?” — “Code Complete” author Steve McConnell told SD West 2004 attendees that good software relies chiefly on personal discipline rather than technology, and [...]
  • 2003: jica — project-type cooperation grant aid donor company will send the experts from universities and private industries technology traansfer, equipment technical cooperation project training center in [...]
  • 2002: Cool mom and Linux — Ooh! And I tried walking my mom through the process of getting the Linux box at home on the Net [...]

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging

Free sample!