Learning Elisp Idioms

I’ve said before that Emacs Lisp is pretty much like any other Lisp except for its library, which is specialized for editing tasks. One of the things I like about Xah Lee’s Emacs Lisp Tutorial is that it doesn’t concern itself too much with Lisp itself but presents Elisp use cases and idioms. If you already know a little of any Lisp, then Xah’s tutorial is a good place to go to come up to speed with Elisp.

Today, I found another good resource: The CategoryCode page on the Emacs Wiki. They’ve got a long list of articles that show you how to do various tasks in Emacs Lisp. One page, the Elisp Cookbook, is particularly helpful. It contains a collection of code snippets for many common chores. Other articles are more specialized; they have, for example, an article on a Password Generator. Some of the articles are quite detailed while others merely describe a library that’s good for doing some task or another.

If you’re new to Elisp but have a basic knowledge of Lisp, I’d start with Xah Lee’s tutorial and then try some of the articles on the CategoryCode page. Of course, the definitive source is the GNU Emacs Lisp Reference Manual, which is also available in the built-in documentation. If you need to know the particulars about some function or slightly broader area, that’s the place to look but I don’t find it particularly useful for learning the ins and outs of Elisp. The other outstanding resource you have for that is Emacs itself. You might try reading simple.el, for example, to see how some of the simple editing functions are implemented. It will give you a good feel for Elisp idioms.

This entry was posted in Programming and tagged , . Bookmark the permalink.