Occasionally someone will stop by my office to look at some code I’m working on and I’ll pull it up in Emacs. Within a few seconds most people ask what editor I’m using and why. After all, it is 2009; surely there exists something better than a 30 year old editor that uses a variant of Lisp as an extension language? Well, I’ve looked and if a better editor exists, I haven’t found it yet.
Language Support
I’ve been using Emacs as my primary editor for the seven years. I’ve written C++, Perl, Python, Scheme, Common Lisp, XML, and Latex in Emacs; each of which was syntax highlighted and indented appropriately. Emacs has allowed me to become proficient at a single editor while still assisting me with all of my text editing tasks.
Source Code Control Support
Over the years I’ve had to edit code that has been stored in Perforce, Subversion, git and CVS. Emacs has support for all of these source code control systems. For most day to day editing tasks involving check in/out and adding/removing files I don’t even need to leave Emacs.
Smart Search and Replace
Emacs has the best search and replace of any editor that I’ve used. It searches and replaces using case “smartly”. In just about every case it does exactly what I intended for it to do by default.
For example replacing “foo” with “bar” in the string “Foo foo FOO” results in “Bar bar BAR”. Each “foo” string was was replaced with a “bar” string that was capitalized to match. If I had replaced “Foo” with “bar”, the string would have become “bar foo FOO” instead; only replacing strings that matched the case exactly.
Ediff
Ediff is a standard Emacs package that is perfect for cleaning up code before committing. It allows you to perform a diff between two buffers (one buffer being the current version in the source code repository if you’re using git, SVN, CVS, or Perforce) and highlights the changes. The key to ediff though is that it allows you to use the “A” and “B” keys to yank changes back and forth between the two buffers. Typically I use this to remove any new line insertions and hunks of debug code that I’ve added before committing.
TRAMP
TRAMP (Transparent Remote Access, Multiple Protocols) is an Emacs package that allows you to edit files on remote systems as if they existed on your local machine. The only difference is a slight delay when reading/saving the file as it has to be done through the connection to the remote machine, which is obviously not as fast as reading/writing to a local disk.
While I typically use FUSE to mount remote directories through SSH, this is only a solution in Linux. TRAMP allows Windows users to edit files on any remote machine that they can FTP or SSH into.
Community
The Emacs community is active and helpful. One of the most useful sites is the Emacs Wiki. Here users post tips, questions and answers, along with helpful bits of elisp that they’ve written. If I want to do something new with Emacs, the Wiki is usually the first place I look. If you’re thinking about trying Emacs, you could do much worse then checking out the Emacs Newbie section on the wiki.


14 comments
Comments feed for this article
July 14, 2009 at 6:46 am
Ralph
I agree with you. Emacs is so powerfull!
In Germany we call something like Emacs
“Eierlegende Wollmilch-Sau” (a mythical animal
which gives you meat, milk, wool and eggs)
Take Care
Ralph
July 14, 2009 at 2:50 pm
Alex Ott
Where are you from in Germany? May be create a German Emacs Group?
July 14, 2009 at 10:00 am
bobby
“While I typically use FUSE to mount remote directories through SSH, this is only a solution in Linux. ”
SSHFS via FUSE is available on the Mac as well (via macfuse).
July 14, 2009 at 8:21 pm
Todd
Thanks for the tip, I wasn’t aware that FUSE was available on OSX. I’ve been resorting to NFS mounts.
July 14, 2009 at 12:57 pm
Igor Hjelmstrom Vinhas Ribeiro
“While I typically use FUSE to mount remote directories through SSH, this is only a solution in Linux. TRAMP allows Windows users to edit files on any remote machine that they can FTP or SSH into.”
That’s not entirely true. You can also mount remote directories accessible through SSH on Windows – as a drive letter, using DokanSSHFs.
http://dokan-dev.net/en/download/
July 14, 2009 at 8:44 pm
Paul
Re: “a 30 year old editor that uses a variant of Lisp as an extension language…”
I think it would be more accurate to say “a 30 year old Lisp environment that happens to come with some code for text editing set to run at startup”
July 14, 2009 at 8:54 pm
oylenshpeegul
Plus we’re still getting great new things…like org-mode!
http://orgmode.org/
July 15, 2009 at 8:45 am
Mike
About source control integration: Git can be used via the standard vc-mode that comes with Emacs, but Magit (http://zagadka.vm.bytemark.co.uk/magit/) is quite a bit better. I have been very impressed.
Btw. Emacs 23 release is currently scheduled for July 22 and the final pretest release 23.0.96 has been out for a while.
July 16, 2009 at 1:40 am
Cezar
I love Emacs but In the web dev world it still needs a better multi mode integration, like when you need to edit html, css, js, ruby all in the same buffer. All the currently available modes get the syntax highlighting wrong.
July 16, 2009 at 3:54 pm
Vincent
Oh, yes, for this feature you need to use Vim (I just tested, hehehe…
).
July 16, 2009 at 4:12 pm
Random Links #12 | YASDW - yet another software developer weblog
[...] Emacs: Still Relevant After 30 Years Verwende zwar nicht emacs, aber immer mehr und intensiver den VIM. Ja, die Lernkurve ist bei beiden steil, es rentiert sich aber auf alle Fälle. [...]
July 16, 2009 at 5:54 pm
Cay Horstmann
Another reason why I keep going back to Emacs is shell mode. When playing with an interactive programming language (Scala, Prolog, etc.), shell mode is invaluable.
July 16, 2009 at 7:33 pm
David Emery
Yup. I tell people that the only justification for VI is to edit the makefile (if needed) for EMACS
July 17, 2009 at 3:44 pm
Emacs: my first achievements, frustrations and impressions – gnapse.com
[...] strengths, its ability to be customized, comes to the rescue. Actually this feature is what makes Emacs still relevant after 30+ years. My Emacs after being [...]