Theresa O’Connor

Learn Emacs in Ten Years

Somebody emailed me the other day, asking about how to go about learning Emacs. This is my (edited and rearranged) reply.

I know you’re something of an emacs wizard, so I thought I might as well ask you: how should I learn emacs? … I’ve used emacs for several years now but have not added very much emacs skill to my repertoire.

Well, the short answer is, you should learn Emacs by using it for about a decade. That’s a pretty lame non-answer, so let me try to elaborate.

I started using Emacs in the fall of 1997, as a freshman in college. For at least the first year or so of using Emacs, my Emacs repertoire probably consisted of tens of key bindings (not counting the myriad bindings of self-insert-command, of course), and only a handfull of major modes (c-mode, java-mode, makefile-mode, that might be about it). So basically, for at least a year, my use of Emacs didn’t differ substantially from the average user of, say, Notepad.

I distinctly remember a moment during my sophomore year, while in a professor’s office talking about some assignment or some such, being amazed by some crazy magic he worked in an Emacs buffer, making seemingly very complex edits in a dizzyingly short amount of time. I remember asking what the hell he had just done. He had a good laugh—at this point, I was known among other students as “the Emacs guy,” and yet I didn’t even know how to record or use keyboard macros. This was pretty embarrassing.

I’ve continued to use Emacs this whole time, and it turns out that I’ve learned a lot about it since then. I continue to learn about it every day. The thing is, this isn’t even about Emacs specifically. It takes about ten years of such practice to learn anything well. From Norvig (emphasis his):

Researchers (Bloom (1985), Bryan & Harter (1899), Hayes (1989), Simmon & Chase (1973)) have shown it takes about ten years to develop expertise in any of a wide variety of areas, including chess playing, music composition, telegraph operation, painting, piano playing, swimming, tennis, and research in neuropsychology and topology. The key is deliberative practice: not just doing it again and again, but challenging yourself with a task that is just beyond your current ability, trying it, analyzing your performance while and after doing it, and correcting any mistakes. Then repeat. And repeat again. There appear to be no real shortcuts: even Mozart, who was a musical prodigy at age 4, took 13 more years before he began to produce world-class music. In another genre, the Beatles seemed to burst onto the scene with a string of #1 hits and an appearance on the Ed Sullivan show in 1964. But they had been playing small clubs in Liverpool and Hamburg since 1957, and while they had mass appeal early on, their first great critical success, Sgt. Peppers, was released in 1967.

So how do you get from where you are to using Emacs so much you spend your spare time hacking on various Emacs libraries for fun? Mostly by making a point of using Emacs for all of your editing needs, and allowing Emacs to slowly take over your other computings tasks as well.

For instance, the big application that people typically expand their Emacs-fu with is using Emacs to read mail (see also Zawinski’s Law of Software Envelopment). I recommend trying Gnus. The several weeks you waste trying to figure out how to point Gnus at your mail server more than pays for itself by the amount you learn while driving yourself mad.

Emacs is called “the extensible, customizable, self-documenting real-time display editor.” I want to draw your attention to the self-documenting part. Perhaps the most critical Emacs skills to develop early on is how to navigate and interrogate Emacs’ help features, which are extensive. Type C-h C-h to get started down that path.

(related: what is the best tutorial/book on emacs lisp?)

IIRC I learned elisp via a combination of bumbling, Usenet, and Glickstein but, honestly, I think the elisp manual & tutorial (combined with the Emacs manual itself) are much better than muddling through like I did. (Though, if you’d like, you can borrow my ancient and increasingly-inaccurate copy of Glickstein.)

Here’s a breakdown of the above commands so you know what each part is about:

C-h i
brings up the Emacs interface to Info, the GNU documentation system
d
goes to the Info root menu (in case you were already somewhere else in Info)
m emacs RET
opens the Info menu item named emacs

For real-time help from friendly experts, try the #emacs IRC channel on Freenode. Eventually, you might try IRCing from within Emacs; there are several IRC clients, including two which ship with Emacs itself.