Appendix B. Lisp Quick Reference

This appendix summarizes general Lisp syntax as used in Emacs, and some important Lisp functions. It does not summarize Emacs-specific features such as buffers, hook variables, keymaps, modes, and so on. For a complete Emacs Lisp reference, see The GNU Emacs Lisp Reference Manual. Details on obtaining it are in Appendix E.

Basics

A Lisp expression is a unit of data that can be evaluated. The expression may be composed of subexpressions, as in the cases of lists and vectors.

Every Lisp expression has a way to produce a value when evaluated. Most kinds of expression are self-evaluating, which means that they are their own value.

A Lisp expression can be treated as literal data instead of being evaluated. Non-self-evaluating expressions must be quoted in order to use them as literals and prevent them from being evaluated.

The symbol nil denotes falsehood. It is exactly the same object as the empty list, (). Every other Lisp object denotes truth, but the symbol t is reserved to mean truth anyway.

Emacs Lisp (unlike some other dialects of Lisp) is case-sensitive.

Get Writing GNU Emacs Extensions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.