Previous: Creating Symbols, Up: Symbols

8.4 Property Lists

A property list (plist for short) is a list of paired elements. Each of the pairs associates a property name (usually a symbol) with a property or value.

Every symbol has a cell that stores a property list (see Symbol Components). This property list is used to record information about the symbol, such as its variable documentation and the name of the file where it was defined.

Property lists can also be used in other contexts. For instance, you can assign property lists to character positions in a string or buffer. See Text Properties.

The property names and values in a property list can be any Lisp objects, but the names are usually symbols. Property list functions compare the property names using eq. Here is an example of a property list, found on the symbol progn when the compiler is loaded:

     (lisp-indent-function 0 byte-compile byte-compile-progn)

Here lisp-indent-function and byte-compile are property names, and the other two elements are the corresponding values.