Why Emacs is the only editor I can use
Alex Payne – who I sincerely hope does not become a regular foil – agonizes about Mac users using “old text editors.” Phil Hagelberg responds.
My 2¢: What I demand in an editor, in rough order of necessity, is:
- Syntax highlighting for a wide variety of programming languages and file formats.
- Tight integration with source code management, preferably supporting multiple systems.
- Transparent access to local and remote files.
- An uncluttered user interface. The exact opposite of this.
I have found no other editor which can compete with Emacs for those features. There are a couple that come close. TextMate lacks remote file access; BBEdit is also close, but the cost is off-putting.
Emacs excels at all of these, and much more. But those are the core features I can’t live without. In particular, Emacs’ SCM integration is unmatched. It supports most anything you’d want to do (view revisionlog, annotate, add, commit, diff vs. BASE, resolve conflicts, edit log message), and these are all tied together. If you’re looking at the revision history, you’re one keystroke away from opening that revision of that file, or a diff of the changes in that revision. If you annotate a file, you’re one keystroke away from viewing that revision’s diff, log message, or looking back another version. If you get a diff of your changes, you can easily revert some changes while keeping others.
It’s extremely comprehensive, and it makes working with SCM ridiculously easy. When you want to commit changes to a file, you hit C-x v v, edit your log message right there, and finish the commit with C-c C-c. It’s about as unobtrusive as you can get; there’s no need to context switch into some other app. And it works the same with any SCM: CVS, SVN, Git, Arch, BZR. Again, no context switch, like with some editors that work differently depending on the SCM.
So. There are lots of other things I like about Emacs, but those are the core things I need to be productive. And Emacs just does them better than any other editor. If you have suggestions of other editors that might, I’d love to hear them.

October 28th, 2008 at 11:04 pm
I’ve never been anyone’s “regular foil”. Maybe it’d be fun. We could schedule the foilings, and such. I’ll start a Google Calendar.
At any rate, thanks for sharing more about why you like Emacs. A couple thoughts, not necessarily in defense of TextMate as a “better” editor but just as another solution:
1. Remote file access can (and probably should) be a job for something lower-level than your text editor. I’ve seen people use MacFUSE and similar to edit remote files over virtual network shares with apps like TextMate or BBEdit.
2. The Subversion bundle for TextMate is good, but the Git bundle is *great*. It’s a very different approach than Emacs takes, though, providing a fairly rich GUI for the various SCM operations. This obscures the editor’s contents, which Steve Yegge and other Emacs folks seem to think is a big text editing no-no, but in practice I don’t find it to be trouble.
October 29th, 2008 at 12:30 am
Emacs VC system is definitely good but was clearly designed around CVS. C-x v v commits your current file. Now VCS work with delta being changesets, and it has been so since subversion. I think VC interface should be a bit revamped to allow whole project changeset commit instead of just current file.
Other than that, anyone having seriously tried editors out there will know that Emacs just stands above anything else.
October 29th, 2008 at 1:05 am
I’m also can not switch from Emacs for almost same reasons - editing of source code in many languages, use of different SCM, editing of text, etc.
But also, there are almost no alternatives to Gnus, and some other packages. And unified commands/key-bindings is also great help in day-to-day work…
And another reason not to use TextMate — it run only on one platform, while i can use Emacs on lot of different platforms, and i always use same keys, commands, etc. And emacs configuration is always with me, so i can quickly start work on any computer, where i can download emacs
October 29th, 2008 at 1:30 am
@alex:
Tramp (emacs’ most commonly used method for remote file access) is (more-or-less) just a wrapper for external tools like ssh, sftp, and similar. I don’t think that the remote-access capability is built directly into emacs - calling the tools needed to edit remotely is just automated, and an interface similar to what is used to normally open files in emacs is added to the editor.
October 29th, 2008 at 2:37 am
> Remote file access can (and probably should) be a job for something lower-level than your text editor
My thoughts exactly. A text editor, however powerfull and feature-rich its back-end might be, can never hope to achieve the same level of functionality as a native solution. Which is one of the reasons I find TextMate’s approach to “scripting” very interesting (but questionable at the same time).
October 29th, 2008 at 4:13 am
I’m also a big fan of VC (the SCM integration in Emacs you’re talking about), but I’ve recently learned that it has at least one fundamental major flaw: it’s inherently single file oriented, due to it’s rcs ancestry. There is also PCL-CVS which provides a more repository centered approach, but AFAIK it still lacks support for the newer kids on the SCM block. PCL-CVS is also not at all a pleasure to use, to me the right way to go would be to add SCM features to dired (although I don’t particularly like dired, either).
It’s also not true that Emacs SCM integration brings you everything you need. As an example, AFAIK there is no vc-svn-reintegrate. Also, there is no tight integration with a 3-way diff, in case you’re running into conflicts.
Now, I’m not claiming that Eclipse or any of the other editors offers superior solutions, but at least the SVN integration of Eclipse doesn’t look too bad to me in comparison. For a little bit more complex cases it’s probably still the best approach to use the command line.
October 29th, 2008 at 7:02 am
Here’s what I love about Emacs: text editing. It’s unrivaled. I’ve used a lot of IDEs over the years, but I’ve had an ongoing love affair with Emacs for 10.
Some features I can think of now:
- A lot of editors make it hard to switch line endings. I do Esc-% C-q m [ret] or whatever. (I’m so used to it I can’t remember the key sequence. :-)
- Open somebody’s poorly formatted source. C-\. Done.
- Kill and yank. Paste something, cut something else, yank back to pastes ago. Fantastic.
- c-backslash-region for when you’re writing complicated macros you don’t want to look like an obfuscation contest.
- diff-buffer-with-file for when you forget what you changed in a buffer, compare it to disk. Awesome.
- untabify there are people out there who use tabs. *shrugs*
- So a bunch of editing and want to undo something 20 edits back, select the region and hit undo. Emacs will undo only the selection. Cool.
- C-v = diff against version control and apply or undo chunks. Awesome when you try something out that didn’t really work out but you want to keep parts of it.
- M-x compile, compile right from the editor. Not whatever project your IDE supports — anything. I have a cool lisp file that keeps a compiler in memory for Flex apps, meaning what would take minutes to compile with ant is done in seconds.
- M-x shell. Run a shell from within emacs. Get all the cool editing features. For example, I use it a lot for running Java programs that don’t have readline support. From emacs, I can M-p to get the previous command.
- M-/ completion. Not like an IDE that has to know the api and all sorts of syntax, but it tokenizes open files and completes *anything*. Works in XML just like it does in Java or C files.
There’s lots more…
October 29th, 2008 at 9:32 am
@Alex, I haven’t used MacFUSE specifically, but I’ve used various solutions like it before. I’ve found them wanting. In particular, none of them have been very robust - if the connection drops, things fall apart. Tramp is much more robust. If the SSH (or whatever) process dies, it just fires up another. It also has features FUSE lacks, such as multi-hop and sudo access. I can edit a file as root on a box which is only accessible via SSH from a different system. Having this stuff at the editor level gives you a level of integration that you can’t get with FUSE.
We’re on Subversion at Digg, so I haven’t played with Git. I think it’s unfortunate that the quality of SCM support in TextMate varies so much from one to another. I don’t like features that make me context switch, which is one of the things I love about VC.
@paul.r, @schaueho, This is definitely a drawback, but it’s getting addressed in Emacs 23: http://psung.blogspot.com/2008/01/manipulating-changeset-based-vcs-from.html - and of course you can grab the updated vc-mode and use it in Emacs 21.
There are definitely SCM-specific operations that VC doesn’t cover. But it should be trivial to implement new operations if you need something specific.
October 29th, 2008 at 9:46 am
All of these things are nice and all, but the thing that keeps me chained to VIM (though Ian’s constant harping is causing me to rethink checking out Emacs) is the simple fact that I don’t have to use a mouse. Muscle memory is the single biggest thing that keeps me using VIM.
October 29th, 2008 at 10:05 am
@Joe, You don’t have to use a mouse with Emacs. It’s strongly discouraged, in fact.
October 29th, 2008 at 12:43 pm
But there are so many more things in emacs beside what you mention! Narrow mode, outline mode, automatic code intendation, code templating, you name it, it’s there.
October 29th, 2008 at 2:27 pm
@Mike, Oh, I’m sure that if I had an editor with those three specific functions, I’d still miss many of the little features Emacs has, including some I implemented for myself. I just didn’t want to get to the point where I was listing off everything I use Emacs for, which would naturally eliminate many alternatives.
I tried to come up with only the most critical things. I can imagine living without narrowing and outlining, but I can’t work without tight SCM integration.
October 30th, 2008 at 5:03 am
Settle for nothing…
While I’m usually a happy VC user (the SCM mode of Emacs) as the next guy, I recently haven’t been always so happy. In particular when I’m working on a larger set of changes in multiple files (using Subversion or Mercurial), the commit-per-file appr…
October 30th, 2008 at 5:57 am
I used to be a pretty die hard Vim user, but ever since the ‘column edit’ mode in TextMate, I find myself bringing in source files from other editors (read Eclipse) just to use column edit mode in TextMate.
The keybinding and macro stuff in TextMate is (IMO) considerably harder to work with than in Emacs or Vim, but I’m willing to suffer through that for the other features.
Source control integration isn’t quite as important to me, as there are major context shifts before I check in anyway (run cmd line build, run tests, run build & RPM packaging on Linux VMware, deploy, test) so I don’t mind popping over to P4V or something else to do the check-in.
October 31st, 2008 at 2:33 pm
Well I think you have some good points, indeed E-Macs is a very fine operating system, but the only thing it seems to lack is a solid text editor. ;) nyuk, nyuk, nyuk….
I think it just boils down to what you learn fast, having been a VI user for 10 years I can’t quite seem to make a lasting switch.
%s/vim/emacs/g = error
November 4th, 2008 at 9:58 am
@John:
I do not know whether it does the same (or more), but in cua-mode you have a column editing mode in Emacs (I do not know why it is only available in that minor mode, which is its only drawback):
M-x cua-mode RET
to get to cua-mode
C-RET
to start column edit
November 12th, 2008 at 6:46 am
mmmmm….eeeclipse…autocomplete those long functionnames for me….mmmmmmm….mesa like