Welcome to ttn's Emacs Lisp tutorial (version 2.05)!


This directory contains a simple Emacs Lisp tutorial, released under GNU GPL, presented in several lessons. After going through the lessons, you should be familiar enough with Emacs Lisp to read and write programs of moderate complexity, and to continue your studies independently.

Before you get into this particular tutorial, check out the most excellent Emacs-Lisp Intro by Robert J. Chassell. Recommended.

See the author's free software page for other (potentially :-) educational works.

How to begin

To follow along properly, you will need an Emacs running under a sane operating system, such as GNU/Linux. If you are stuck under anything by Microsoft, the tutorial is still workable, but will probably be less fun. You must start Emacs by typing at a command prompt: "emacs -q" and pressing Return (or Enter as you may see on your keyboard). This is recommended over starting Emacs from a pull-down menu because the "-q" option means "quick start"; the normal initializations that take a long time are bypassed. This also helps us stay on the same page, for some of these initializations may not be compatible with this tutorial.

One exceptionally useful feature that "emacs -q" does not normally provide is font-locking (also known as syntax highlighting). It is ok to enable this feature (with command `M-x global-font-lock-mode'); the tutorial does not make use of font-locking but by the same token is not harmed by it. [Update 2012-11-05: As of Emacs 22, font-locking is enabled by default, so there is no need to manually enable it.]

Although the page you are reading is html, the body of the tutorial is presented as heavily commented Emacs Lisp code. It is extremely important that you save each lesson as a writeable file that is opened from within Emacs by `M-x find-file'. Simply reading the file may offer you some insight, but the whole point of the tutorial is to viscerally interact with the Emacs Lisp programming environment (that is, Emacs). Thus, the only way to proceed is to grab the gzipped tarball (version 2.05) and unpack it locally, so that you can modify the files for maximal empirical benefit.

Start with lesson01.el. There will be times when you are asked to do certain things in Emacs; these are identifiable by a prompt consisting of two greater-than signs. The instructions follow. Try to follow the instructions in the order given; the tutorial usually depends on this.



The following people have provided valuable comments and ideas. The tutorial is richer through their participation.

Richard Stallman, Jeff Tuckey, Daniel Moore, Sridhar Gopal, Odile BĂ©nassy, Marco Antoniotti, Alix LHERITIER, Jeremy, Siddharth Patil, tboult.

Please feel free to join these folks by sending feedback on tutorial content or style, or anything else related to learning Emacs Lisp.

Copyright (C) 1999-2002,2004-2005,2008-2009 Thien-Thi Nguyen