[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

AD.2 Variables

A variable is a Lisp symbol which has a value. The symbol's name is also called the name of the variable. A variable name can contain any characters that can appear in a file, but conventionally variable names consist of words separated by hyphens. A variable can have a documentation string which describes what kind of value it should have and how the value will be used.

Lisp allows any variable to have any kind of value, but most variables that Emacs uses require a value of a certain type. Often the value should always be a string, or should always be a number. Sometimes we say that a certain feature is turned on if a variable is "non-nil," meaning that if the variable's value is nil, the feature is off, but the feature is on for any other value. The conventional value to use to turn on the feature--since you have to pick one particular value when you set the variable--is t.

Emacs uses many Lisp variables for internal record keeping, as any Lisp program must, but the most interesting variables for you are the ones that exist for the sake of customization. Emacs does not (usually) change the values of these variables; instead, you set the values, and thereby alter and control the behavior of certain Emacs commands. These variables are called user options. Most user options are documented in this manual, and appear in the Variable Index (see section Variable Index).

One example of a variable which is a user option is fill-column, which specifies the position of the right margin (as a number of characters from the left margin) to be used by the fill commands (see section T.5 Filling Text).

AD.2.1 Examining and Setting Variables  Examining or setting one variable's value.
AD.2.2 Easy Customization Interface  Convenient and easy customization of variables.
AD.2.3 Hooks  Hook variables let you specify programs for parts of Emacs to run on particular occasions.
AD.2.4 Local Variables  Per-buffer values of variables.
AD.2.5 Local Variables in Files  How files can specify variable values.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 2, 2002 using texi2html