Saturday, November 12, 2005

Learning GNU Emacs

I've been reacquainting myself lately with Emacs, which I've used off and on for nearly 15 years. The off part is because I occasionally think that it's ridiculous for a liberal arts-educated news editor to be using Emacs, possibly the most complex text editor ever devised and usually thought of as a tool for programmers. This monster of a program is dedicated purely to moving characters around, inserting them and deleting them. That's it. Nothing else. Yet it includes way more features than Word or even most professional publishing programs. It even includes its own psychoanalyst.

So once in a while I decide it's time to grow up and start using WYSIWYG (What You See is What You Get) programs such as Microsoft's Word, which I have to use it at work anyway, or OpenOffice on Linux. But that's equally silly. I can count the formatting attributes I care about on less than one hand -- italics, bold, centred and, um, that's about it. I rarely print, and in 20 years of reporting and editing, I've never cared what the output looks like, ever. Just give me a word count and off I go.

And nothing, with the possible exception of another editor called Vi, is more powerful at flinging words around than Emacs. It isn't very easy to learn, but once you do, it's easier and less distracting to use. I like how I can keep my hands on the keyboard at all times and jump anywhere in even the longest documents with a keystroke..

What got me back to Emacs this time was Tim Bray's ode to Emacs on the Mac, which I read after a long time exploring "Web 2.0" editors such as Writely. This time, I also picked up a copy of the latest version of O'Reilly's Learning GNU Emacs because I need a refresher and there's always something new to learn about Emacs. What I especially liked about this book is that it focuses on the aspects of the editor that are useful for any writer, not just for the programmer. The first two-thirds of Learning GNU Emacs is about writing features, such as the built-in outliner, searching, moving text around, and creating macros.

One side of Emacs that I haven't explored too deeply before is customising it. The book goes into the programming language that Emacs uses for customization, a variant of Lisp called elisp. Lisp isn't for the faint of heart. As the book points out, it's one of the oldest high-level languages and was designed when it was more important to be easy on the computer than on the programmer. The authors (there are several -- Debra Cameron, James Elliott, Marc Loy, Eric Raymond and Bill Rosenblatt) do an excellent job of walking through the basics of adding small features, customising the many "modes" that Emacs has and even developing your own mode from scratch.

I think I'll stay in Emacs for a while. For what I do, it still hasn't been beat.


Tags: , ,