Categories

Author

The Ghost in the Lisp Machine

January 14, 2007 — jao

A friend of mine uses to say that Emacs fills our yearning for a Lisp Machine. I tend to agree with him: Emacs is not just an editor, but a full integrated environment where you can perform virtually any imaginable task; and, most importantly, the inner workings of the system are open to you to explore and extend. Using, for extra fun, Lisp. No, i don’t think that Elisp is the nicest Lisp incarnation around, but is far better than, say, C, and i still prefer it to other scripting languages. Moreover, the awesome range of libraries at your disposal makes up for many of the deficiencies in the language.

Living in Emacs is addictive. Imagine an operating system where you can switch from writing code to browsing the web or chatting without leaving a consistent environment, with the same set of commands and shortcuts. Imagine a set of integrated applications where data is seamlessly shared, where any single functionality can be tweaked, extended and adapted to your particular needs. Where everything is easily scriptable. Imagine, in additon, that the environment provides powerful and complete interactive self-documentation facilities with which the user can find out what is available. I have yet to find an operating system providing such an integrated environment. Not even Mac OS X, where AppleScript support is often lacking and system services are underused.

Of course, the key ingredient here is Emacs’ extensibility. Far from being an afterthought or simply one of its features, extensibility is the central aspect of Emacs’ architecture. Actually, the whole point of this post is to recommend you reading Richard Stallman’s 1981 essay EMACS: The Extensible, Customizable Display Editor, which explains much better than I could the strong points of Emacs design, i.e., those traits that make Emacs more, much more, than just an editor. From the horse’s mouth:

Extensibility means that the user can add new editing commands or change old ones to fit his editing needs, while he is editing. EMACS is written in a modular fashion, composed of many separate and independent functions. The user extends EMACS by adding or replacing functions, writing their definitions in the same language that was used to write the original EMACS system. We will explain below why this is the only method of extension which is practical in use: others are theoretically equally good but discourage use, or discourage nontrivial use.
[…]
User customization helps in another, subtler way, by making the whole user community into a breeding and testing ground for new ideas. Users think of small changes, try them, and give them to other users–if an idea becomes popular, it can be incorporated into the core system. When we poll users on suggested changes, they can respond on the basis of actual experience rather than thought experiments.

The article goes on explaining the organization of the Emacs system, how it depends on its interpreter, Elisp’s main features and how built-in self-documentation is provided. Also interesting is the list of related systems at the end of the essay: Lisp machines, LOGO, MacLisp and Smalltalk. We’re definitely in good company!

Clint: Definitely. You can have both GNU Emacs and XEmacs. I use GNU Emacs, and I use the CVS version. The current official release is 21 but 22 is under way and we hope it will be released Really Soon Now. You can get a recent CVS version, including installer, here: http://ourcomments.org/Emacs/EmacsW32Util.html

One niggle though, I have been trying to script web screen scrapers in w3m (w3m which rocks BTW), and ran into a problem with scripting in Emacs. I cannot, for the life of me, figure out how to get an Emacs script to pause and wait for a web page to load in w3m or any other operation that takes time in the OS, etc.. Maybe someone here can advise. Thx.

I used it regularly for about 3 years: Gnus, Editing, Compiling, Diff-mode, etc. The thing that kept nagging me about Emacs was the RSI factor. I was discussing this with one of my vim-using friends and he asked if I had ever seen RMS’ hands.

…and then was I aware that RMS employed a typist….

I love the idea of the Lisp machine, but I’m interested in hacking for many years – and I’m afraid that emacs will impair the quality of that run.

The RSI problem can be dealt with by swapping the “caps lock” and “control” keys. I had problems with incipient chronic RSI and began trying to hold the “control” key with different fingers. All that disappeared the moment I swapped those keys.

@SGH: Yes, RSI can be a nuisance with Emacs. If you’re better off with vi, congratulations. For those, like me, who want to stay with Emacs, there are lots of things to try. (I don’t have as severe problems as some other people do, so I manage without changing everything about how I work.) I’ve written up my own experiences here:

I had severe RSI problems a few years ago. Already had the Ctrl key remapped to the key just left of the A key. I found that switching to the Microsoft Natural keyboard completely (and cheaply) relieved all my pain. I’m not normally a fan of Microsoft, but I have to admit that this keyboard worked well for me. YMMV.