Ten (mostly) false ideas about emacs
mai 18, 2007 by alexandrulz
Whenever I say that I use emacs (and like it), people’s virtual faces turn against me in a strange manner. How can you use that thing? Man, those are nasty keybindings. Why not vi? To many, Emacs seems like some sort of an early jet airplane: you can do anything with it, but how can one manage to fly it without crashing it into the ground looks like a mystery. Emacs is not exactly a beast — in fact, it’s quite friendly once you adjust your perspective. This doesn’t save the long and sometimes surprising explanatory part.
I’ve tried to compile a couple of the most common misconceptions about emacs. They don’t have a “reliable” source — these are simply the most usual ones I found in my wanderings for the last few years of using emacs. Questions that were asked to me on the IRC, on forums or mailing lists.
#1. Emacs is very hard to learn.
This can be true for some people, but it is in fact an inexact statement. In my case, emacs was actually the first editor I used, and it was not hard. In order to use emacs like you use, say, Notepad, there are only five or six keystrokes you need to remember. The difficulty is not in learning emacs, but in adjusting to it. Even so, most users become comfortable with emacs after two or three days of constant usage.
There are several funky things about emacs. Some of them are powerful and actually extremely useful, but as a casual user, the point is rarely seen. You can move the cursor using the arrow keys, but you are constantly reminded that you shouldn’t do that. Files are edited in buffers, which are written to the file when the file is saved — and so on, things which seem like arbitrary crap from stone age, but which are actually useful to some people.
Some of these funky things are, however, arbitrary crap from stone age. What emacs calls a frame is, in modern terms, a window — and what emacs calls a window should actually be a frame. The same probably goes for the somewhat arcane user interface (although most emacs users, including me, will insist this is a feature, a design element which we all love). The reason why these haven’t changed has more to do with the emacs community being used to them, with developers being somewhat reluctant to change them, with the huge list of user scripts that would have to be changed if windows became frames and so on. These are a couple of things that newcomers will eventually have to adjust to — which is not necessarily a weakness. Every major environment has its own strange features. We were all surprised and somewhat unhappy to adjust to clicking Start in order to shut down our computers.
#2 Emacs has a keybinding for everything.
Not really. Actually, most of emacs’ commands are not bound to any keystroke, and for obvious reasons. If you don’t need to quickly go to a certain line in the files you edit, there’s no reason for the goto-line command to be bound to a keystroke. Instead, users are expected to bind their own keystrokes to the commands they want.
This is quite flexible, because it lets users adjust easier if they are used to some other keystrokes. For instance, if you are used to copy-pasting with Ctrl-C and Ctrl-V, you can simply bind them to those, rather than getting used to M-w and C-y.
If you are still wondering why didn’t they just bind all the commands directly, the answer is that there are simply so many commands that a keyboard is simply not enough to meaningfully bind them all. This is why emacs has modes, but I’ll let those of you who don’t know what modes are figure them out by default.
The common complaint in this case is that emacs should have all its functions easily accessible through a menu or a toolbar. Most emacs user laugh heartily at this, not because it sounds naive, but because they can actually imagine it. How many commands do you think Emacs has? 100? 200? Ugh, actually, go in the range of thousands. Most of them are actually commands that belong only to a certain mode.
So how do emacs users remember all the keystrokes and commands? The answer is easy: the don’t. I’ve used emacs for five or six years I think, and I learn new commands all the time.
You only need to know those commands and keystrokes which are relevant to you. If you don’t use SLIME, for instance, there’s no need to remember the keystrokes used by slime-mode (a minor mode used by LISP programmers).
#3 emacs was written a long time ago and it’s hugely out of date
Actually, emacs is constantly being updated and maintained, and users constantly add new facilities to it. How can that be?
The answer is simple: emacs is an extensible editor. Using Emacs LISP, emacs’ own LISP dialect, new functions can be added very easily, while maintaining a reasonably small and stable code foundation.
The underlying code is actively maintained and updated, indeed (note: in the case of most implementation, because there are a lot of editors that behave like Emacs, not just GNU Emacs) . However, this code is responsible for just a small part of the editor’s functions. The rest are implemented in Emacs LISP.
Thus, whenever something new is required, instead of having to change the C source underneath (which is quite tedious and error-prone), someone just writes a LISP script — and usually distributes it too.
As a result, emacs users are well into the “new era” of computing — they can keep a blog, surf the web, chat, listen to music and many other things — all without actually leaving emacs. New functions are simply being added using LISP, as they are needed.
Since such a power is placed in the hands of those who use emacs (many of them being professional programmers themselves), there is always something “new” to add to add to emacs. The only difference between this and most other editors is that you actually get the choice: if you don’t want a certain feature, you simply don’t have it. If you want it, you can find the LISP program on the Internet, or write it yourself.
#4 emacs is only used by programmers
Nope. There is some truth in this statement: a lot of emacs’ users are programmers, but this is simply because emacs is extremely friendly to them.
However, there are a lot of non-programmers who use emacs. Who would do that? Well, let me turn the friendly-advertising-guy mode on:
- Mr. Steven Smart is a mathematician. He needs to write articles using LaTeX, but at the same time he needs to use some other math tools available on his computer. He can work better if these are integrated — so he uses emacs, along with preview-latex.
- Daniel Dork is a physics student. He does some programming, but it’s not his “daily job”. However, he does need his computer for running simulations and keep track of his experiments. Emacs has a very cool diary mode which allows him to use diary entries, and he can also use emacs to write his programs or do calculations.
- Paul Pencil is a writer. He likes emacs’ outline mode, and he hates being distracted by wysiwyg word processors. Besides, emacs has a couple of other functions he likes.
Okay, that felt ridiculous. The point here is: emacs is not something used by programmers only. A lot of users do a lot of things with emacs (I write my articles in emacs, in fact), simply because it happens to be an extremely powerful editor.
#5 emacs has a very ugly and useless GUI
Most emacs users consider a GUI to be useless by itself. Initially, I was tempted to disagree, but the truth is that once you learn the keystrokes, clicking around will seem awfully slow.
Emacs’ GUI is not useless. It provides what it should provide in the context of emacs: quick access to a couple of functions, but that’s just about it. Why?
Essentially, because emacs already has an extremely efficient and powerful interface, except that this interface is not a graphical one. In fact, when emacs appeared, it was unfeasible to have one. Later, a GUI was moderately adopted, but not extended to the point of, say, Microsoft Word’s. Why? Because, after a couple of weeks of complaining, even newcomers actually started to enjoy a life without clicks. In a couple of months, virtually all emacs users become a GUI nazzi. It’s symptomatic — they want to move away all toolbars, all menus, get as much screen estate as possible, get everything out of the way…
Those who do prefer a GUI should be quite comfortable with what Emacs already offers. None of the basic functions are really missing. But oh my God, how the hell can anyone live with that horrible Athena-based interface?
Well, actually, you can get a pretty usable GTK interface for emacs. You can also get a GNUstep-based one with emacs.app. Or, if you use OS X, Aquamacs offers one which is not horrible at all. Windows users get a native-looking interface. And the list can go on.
#6 emacs only runs on Linux and similar geeky platforms
Actually, emacs runs on just about anything. The main names you are probably interested in are Windows, OS X and Linux — yes, it runs on them. But furthermore, it runs on just about any Unix, on many POSIX-accepting systems, like BeOS, and Emacs-like editors (i.e. with similar keybindings and principles, but sometimes without LISP) run on just about anything imaginable, from DOS and Windows to Amiga and even the likes of C64 or Spectrum.
#7 You need to know LISP in order to use emacs seriously
Not exactly. You only need to know LISP if you want to customize or extend emacs.
Before jumping from your seat: emacs offers a neat way of customizing all of its options without using LISP. Should you want to do it more quickly, you only need to know two or three LISP commands, without going into the whole shiFt about S-expressions, cars and cdrs.
As for extending emacs — you will hardly ever be in the situation of learning LISP if you are scared of it. Most imaginable demands are already fulfilled, and if yours go past those, you are likely able to learn LISP.
In fact, LISP’s syntax is incredibly easy once you learn to live with the parenthesis. You can learn LISP to the point where you can extend emacs in one afternoon (ok, you will also need to practice for a few more afternoons), but it’s certainly not as bad as it sounds.
Nevertheless, there are already so many features implemented that you can use emacs well enough without knowing LISP. I have used emacs for more than two years without knowing LISP and it didn’t hurt.
#8 emacs is bloated, damnit, who needs to keep a blog from a text editor?
Actually, there are people who need it, but that’s not the point. LISP is not “bloated”, it’s simply very, very extensible.
For instance, I use w3 to surf the web from within emacs (if I want to google something while I’m coding, I don’t feel comfortable switching environments). If you don’t need a web browser embedded in Emacs, there’s an easy solution: you don’t install it.
In fact, the packages commonly offered by Linux distributions have a lot of things built-in, like C-mode and everything. If you feel that even this is too bloated (or if you actually need to fit emacs in very little memory), you can always recompile it and move out anything you do not need. Still, emacs will work without noticeable problems on slow computers. It’s basically just as quick on my Pentium IV as it is on my older Pentium 233.
#9 There’s nothing emacs can do and other editors can’t
Well, technically speaking, this is correct: if an editor is reasonably extensible (and there are a lot which are — Jedit is the first in my mind), it can do anything that emacs can.
However, there is one thing that these editors don’t have, and that’s the huge base of readily-available scripts. Jedit — which is, btw, an excellent text editor — is about 5 years old or so (or at least the first time I heard of it was in 2002). In 2002, GNU emacs was already 18 years old. But there’s always time to catch up :-).
For my past years of using Emacs, I only had to write my own LISP script once, when I needed a set of quick macros to deal with Qt — and one was already available but I missed it while googling. For everything else — and it’s not a small deal, as I’ve gone through a whole lot of hacks — things were already available.
#9 emacs cannot do wysiwyg
Well, umh, ugh, it’s not really true. You can get reasonable wysiwyg editing functions by using the enriched-mode, and there are tools like preview-latex which were mentioned above. It’s just that emacs users are not really proud of these features so they are just sitting quietly in their corner.
For most newcomers, not having wysiwyg seems like the Middle Age, and if you actually need it, you should really use something else. However, there are a couple of critics who explain why wysiwyg editors are so inefficient: see this, or this.
In other words, you can do at least some wysiwyg in emacs, but you may want not to do it.
#10 vi is so much cooler! I hate remembering keystrokes.
Go away :->.
[Obviously kidding. But, you know... to each, his own]
About point #7 — this is where Pymacs comes in.
I know Python quite well, and only have a basic handle on Lisp. Pymacs allows you to do things in (generally) pythonic ways, and allows full two-way communication between Python and Emacs. You can extend Emacs without knowing lisp, as well.
I do, however, feel that if you don’t know elisp (or at least some kind of binding to them), you are missing out on a lot of cool features in Emacs.
where is the pain in the pinky issue?
Emacs is just better for certain things including integration with gdb. I’ve used Vim as my main development tool for two years now but still use Emacs when working on programs in Linux. Also, ‘Emacs speaks statistics’ is wonderful for R users.
Vim până la moarte, goddamnit!
Amen w.r.t Emacs pinky pains. Did not try the capslock and ctrl key switch yet, as don’t use Emacs seriously yet.
I feel awfully frustrated when I don’t know how to do things that I can so easily do in Vim. There are obvious gaps, but I feel Vim text editing modes is a very good idea, and something that Emacs does not have.
Try Viper mode!
Viper mode is, as far as I remember, a fair choice. I have a colleague who had nice words to say about it, but there’s really little more I can say about it myself.
The pain in the pinky issue is, literally, in the pinky.
the pain in the pinky can bre reduced by swapping Ctrl and Caps Lock keys ..
I had to stop using Emacs years ago because of finger soreness. This pushed from being a command-line wizard to a WIMP-oriented gui user.
And yes, I (painfully) switched caps lock and control. I’ve even done that on my WinXP machine.
Recently I had to do some Ruby on Rails work: Ruby, Css, Javascript, Html et cetera. Emacs was so hard to set up (and I’m an elisp coder) that I gladly paid for a professional GUI editor that did the trick. Nowadays I’d recommend Komodo Edit or Netbeans, depending on how much ram you have…
I actually do not agree with the points, but I hope you dont mind. Please hear me out, it also tackles the “vim vs emacs” issue.
I think people that say either vim or emacs is the solution, are not aware that BOTH are the PROBLEM actually.
Both are too hard to learn/master. They are for pure gurus.
I heard a vim user say he never uses the mouse and if something forces him to use the mouse, he refuses to do so. (I think he uses the mouse for browsing within a firefox tab though, but i am not sure)
Anyway the problem is that it caters to “power users” only. But I would like a GRAPHICAL editor. Something like Textmate on Linux maybe. Many like that editor.
I am - since many years now - using a graphical editor on Linux, one that I was using on Windows just as well (on windows I was using notepad++, on Linux i am too scared to say which editor I am using, because I know the fanhorde of vim and emacs will come shouting at me….
)
I can only recommend that if you are annoyed about either vim or emacs encourage developers of graphical editors that there ARE users that are unhappy with both.
I certainly don’t mind that you do not agree with the points — the world would be so boring if everyone agreed to each other’s points :-).
Personally, I do not think that learning vi or emacs is any harder than, say, learning LaTeX is for somebody who is used to Word’s Equation Editor. Ok, it’s not the best comparison, since LaTeX is so way ahead. There’s a certain shift of perspective into place, and things are not done in the same manner.
I think it effectively boils down to preference. I find it somewhat difficult to hunt for that-particular-option in an application that has hundreds of them, especially when I only need a few.
I am curious at what editor you use though. I had a fairly decent experience with SciTe myself :).
Nice post. I’ve occasionally used Emacs but it’s been so infrequent that I don’t remember most of the key bindings.
As long as I remember C-x C-c, though, I feel perfectly safe to explore
I’ve used GNU Emacs for over 10 years. Every time there is an upgrade, something gets broken. Somebody decides to “improve” one of those ELISP extensions and my .emacs file stops working. Worse yet, it’s often difficult to find out what went wrong — generally I google the error message and somebody has already posted the same problem. But nobody has a response, because often the ELISP has been totally redesigned; it’s not just a matter of, e.g., changing a variable name or a function call.
The pain in the pinky issue is solved by doing the capslock-control swap, which is very easily done in OS X, a little bit harder in most of the flavors of Linux that I’ve tried and I think involves registry editing in Windows.
Another bonus of learning emacs bindings is that you’ll end up finding them in unexpected places. CTRL-E (C-e for emacs users) to move to the beginning of the line, CTRL+K to kill from the cursor to the end, CTRL+F and B to move forwards and backwards and CTRL+N and CTRL+P for moving up and down lines all work for me in firefox text boxes and other random places.
Conclusion: learn emacs to better your life
The pain in the pinky issue is solved by doing the capslock-control swap, which is very easily done in OS X, a little bit harder in most of the flavors of Linux that I’ve tried and I think involves registry editing in Windows.
Another bonus of learning emacs bindings is that you’ll end up finding them in unexpected places. CTRL-E (C-e for emacs users) to move to the beginning of the line, CTRL+K to kill from the cursor to the end, CTRL+F and B to move forwards and backwards and CTRL+N and CTRL+P for moving up and down lines all work for me in firefox text boxes and other random places.
Conclusion: learn emacs to better your life
Thanks for mentioning jEdit! Compared to emacs, jEdit follows the 80/20 rule: it gives me 80% of what emacs would, with 20% of the learning curve and other mild pains.
It’s always kind of sad to see editor wars turn into “emacs vs. vim”, with a little bit of cheerful sniping at heavy IDEs like Visual Studio or Eclipse — with no mention of powerful pure-code editors like jEdit, TextMate, SlickEdit, and so on.
Mentioning jEdit wasn’t really accidental — I actually used it for a few weeks quite a while ago. Unfortunately, afaik it is no longer developed — if I didn’t have Emacs, jEdit would be the next choice.
The emacs vs. vim is largely a tradition. I’d really be curious to see some statistics regarding text editor usage, not Linux-centric, but taking into account all the current major platforms. Something tells me vim and emacs are not even close to the top.
Escape Meta Alt Control Shift!
Learning a standard set of editing keys for cursor movements is a big win. I’m able to use emacs editing keys in all cocoa widgets, the bash prompt, and in Firefox. This makes me a much more efficient computer user, IMHO.
jEdit is under active development — they’re cautious with major point releases (4.3 has been around a long time now), but 4.3 is up to “4.3pre14″ now. The one I reinstalled only a month ago was 4.3pre12.
[...] Here is an article that documents ten falsehoods about Emacs. This was written by Grant. Posted on Saturday, May 3, 2008, at 4:54 pm. Filed under Link. Tagged Emacs. Bookmark the permalink. Follow comments here with the RSS feed. Post a comment or leave a trackback. [...]
Just like Ovidiu C. said: Vim până la moarte!
Great post,
just a few things :
- Lisp ELisp
- JEdit is a great tool too, you’re right; but what about the fonts ? They’re just ugly on my Linux machine. I must miss something, I don’t know what.
- SublimeText will certainly be a strong candidate soon, even if it’s not free (http://www.sublimetext.com/).