Emergency Elisp — cover art: a small storybook field hospital tent at evening with a brass lamp inside, a fox in a white coat holding a small open phrasebook, and a friendly notebook of nested parenthesized shapes laid open on the cot. 🤓

2008 · Stevey's Blog Rants · Primer

“Most Lisp introductions try to give you the Tao of Lisp, complete with incense-burning, chanting, yoga and all that stuff. What I really wanted in the beginning was a simple cookbook for doing my normal stuff in Lisp.”
— From Emergency Elisp, January 2008
Read the essay

© 2008 Steve Yegge. Originally published at Stevey's Blog Rants.

Author’s note

This is something you'd only read if you were serious about learning Emacs. It is almost pure technical writing, designed as a primer, with little interest beyond exactly that.

AI Notes

A phrasebook, not a grammar: much of it runs as side-by-side tables with the Elisp on the left and the Java or JavaScript you already know on the right, down to faking break and continue with catch/throw and building a poor man's class system out of defstruct. Steve promises up front to skip good-vs-bad arguments, then can't quite hold the line, which is where the fun is: he calls dynamic scope "a bad design bordering on evil" two breaths before showing how to exploit it, and observes that "ironically, defconst is variable and defvar is constant." One setf example quietly uses js2-compiler-data field names — this primer was written from inside the big Elisp project Steve shipped two months later, by someone with the burns still fresh.

It is also a period piece now. This is Emacs 22-era Elisp: 29-bit integers, (require 'cl) for anything nice, dynamic scope as the only scope. Emacs has since grown lexical binding, native bignums, and cl-lib, so a few specifics need a mental asterisk, though the reading skills transfer intact — code full of progn and condition-case still looks exactly like this. The last paragraph offers further installments of an Emergency Elisp series if readers wanted more. A second installment never came, so this one page is the entire emergency kit.

Related listings