Book reviewUSENIX

  Bob Glickstein
Writing GNU Emacs Extensions
O'Reilly & Associates, 1997. ISBN 1-56592-261-1. Pp. 215. $ 29.95.

Reviewed by Eric Chin
<[email protected]>

This is a good book. However, I would not purchase it for use as a reference manual. It does contain an appendix titled "Lisp Quick Reference," which valiantly enumerates the essentials of elisp. It does have a usable index, although it is not as outstanding as that of Wright and Steven's TCP/IP Illustrated, vol. 2. Those two features notwithstanding, this book doesn't purport to be a substitute for the Free Software Foundation's GNU Emacs Lisp Reference Manual.

Instead, this book is a great self-study text for a GNU Emacs Lisp 101 class. Coupled with lots of free time, read access to the elisp files that accompany a GNU Emacs distribution, and interactive access to a GNU Emacs editor, one can steadily work through this book chapter by chapter, example by example, and amass a personalized collection of elisp functions.

In my case, each page frequently yielded a new insight or trick. Within two weeks, my review copy had become well marked, with portions of every page I had read highlighted in yellow. Even the footnotes contain useful trivia. For example, did you know that the default keybinding for "eval-expression" recently changed ? Depending on the host I log on to, I either use xemacs version 19.10 or GNU Emacs 19.34, and I was puzzled by the latter version's unwillingness to react to "ESC-ESC." This was a minor enough issue that I did not pursue it, but simply resorted to using "M-x eval-e TAB" instead. However, when I finally got around to reading page 9 of this book, a footnote there immediately shed light on the matter, explaining that with the advent of GNU Emacs 19.29, the default keybinding had been changed from "M-ESC" to "M-:".

As with any programming text, this book is best read within one arm's length of an interactive terminal, preferably one rendering a GNU Emacs window. Then, when confronted with an unfamiliar built-in elisp function, one needs only to use "M-x describe-func TAB" to retrieve the built-in documentation for that function. Even better, as one encounters each elisp example, one can immediately try it out by having Emacs evaluate it.

As a programmer, I often insert the current date into comments embedded within source code I edit. For this, I resort to "C-u M-! date," coupled with a little manual editing. However, for those who prefer elegance, chapter 4 presents a simple function that accomplishes this simple task, then evolves it into a set of functions that modify all time stamps within an Emacs buffer.

Therein lies the approach taken by this book toward the goal embodied in its title. The capabilities and secrets of elisp are presented as a side effect of accomplishing various editing tasks. Each function builds on and references concepts and constructs introduced in earlier sections. This is an effective presentation, but it obligates the reader to work through the book sequentially. One would be hard-pressed to randomly open the book at, say, chapter 7 and make much sense of it, without first having digested chapters 2, 3, 4, 5, and 6.

Nevertheless, if you are an Emacs enthusiast, I would recommend this book: not for your bedside bookshelf, but for that stack of books on your desk that you read while waiting for the compiler to rebuild an entire program suite.

 

?Need help? Use our Contacts page.
First posted: 3rd December 1997 efc
Last changed: 3rd December 1997 efc
Issue index
;login: index
USENIX home