UKUUG home


(the UK's Unix & Open Systems User Group)






Book Discounts

Other Discounts

Mailing lists






An introduction to Programming in Emacs Lisp Robert J Chassell
Published by GNU Press
289 pages
£ 19.55
Published: January 2004
reviewed by John Collins
   in the December 2004 issue (pdf), (html)

Users of the Emacs editor are probably aware that its functionality, with all the operating ``modes'' of the editor are constructed from an internal programming language called Emacs Lisp or ``Elisp''. Emacs is basically an interpreter for this language, which is based upon ordinary Lisp, with built-in functions for manipulating files and windows and for responding to key presses and mouse clicks.

If you want to write your own ``modes'' for handling documents you commonly deal with or for writing functions to process data in particular ways, you will need to get to grips with Emacs Lisp. At a risk of being heretical here, and as much as I can't live without Emacs, I think this is a mistake. Lisp is a ``functional'' language, with things like recursion and functions that generate other functions second nature, as opposed to ``procedural'' with a list of jobs to do like the contents of a C or Perl function, yet what you do with editors 99% of the time is inherently procedural - something that Lisp handles only as an afterthought with ``progn'' blocks and the like.

Nowhere is this more obvious than with keyboard macros, which are stored as a sequence of keystrokes (which might differ in effect in different modes) rather than the functions they invoke. Even MS Word ``Record Macro'' does better than this if you can live with Basic. I can't see that many people will want to get deep into a language whose only function is to extend an editor. If I want to do systematic changes to sets of files, I'll reach for Perl or shell scripts.

Lisp is not an easy-to-read language. Everything is expressed as deeply nested lists, with parentheses used to set out the lists. Constructs with 10 or more consecutive closing parentheses are far from uncommon. You will definitely need an editor which tracks parentheses to write it (of course Emacs does this well).

All that said, I think this book handles the subject carefully and well, with lots of examples and exercises for you to try. To work with this book you will need to be able to try out examples on Emacs itself. Be careful though, some distributions make the default mode something other than ``lisp interaction'', which is the default for ``vanilla'' emacs.

The book takes you from the beginning, through the basics of Lisp and at an early stage you can try out examples whilst functions, interactive functions and commands, conditionals and so forth are explained. The book covers in turn all the aspects of the editing system, regular expressions, loops, customisation and debugging, all with plenty of examples.

I am sure this will enable the reader to feel confident in extending Emacs with this book. Alas that is likely to be all he can do with his new-found knowledge. But if you want to do it, this is a good book to learn from.

Back to reviews list

Tel: 01763 273 475
Fax: 01763 273 255
Web: Webmaster
Queries: Ask Here
Join UKUUG Today!

UKUUG Secretariat
More information

Page last modified 02 Apr 2007
Copyright © 1995-2011 UKUUG Ltd.