Next: , Previous: , Up: Init File   [Contents][Index]


27.6.1 Init File Syntax

The init file contains one or more Lisp function call expressions. Each consists of a function name followed by arguments, all surrounded by parentheses. For example, (setq fill-column 60) represents a call to the function setq which is used to set the variable fill-column (see Filling) to 60.

The second argument to setq is an expression for the new value of the variable. This can be a constant, a variable, or a function call expression. In the init file, constants are used most of the time. They can be:

Numbers

Integers are written in decimal, with an optional initial minus sign.

If a sequence of digits is followed by a period and another sequence of digits, it is interpreted as a floating point number.

The number prefixes ‘#b’, ‘#o’, and ‘#x’ are supported to represent numbers in binary, octal, and hexadecimal notation (or radix).

Strings

Lisp string syntax is the same as C string syntax with a few extra features. Use a double-quote character to begin and end a string constant.

Newlines and special characters may be present literally in strings. They can also be represented as backslash sequences: ‘\n’ for newline, ‘\b’ for backspace, ‘\r’ for return, ‘\t’ for tab, ‘\f’ for formfeed (control-l), ‘\e’ for escape, ‘\\’ for a backslash, ‘\"’ for a double-quote, or ‘\ooo’ for the character whose octal code is ooo. Backslash and double-quote are the only characters for which backslash sequences are mandatory.

You can use ‘\C-’ as a prefix for a control character, as in ‘\C-s’ for ASCII Control-S, and ‘\M-’ as a prefix for a Meta character, as in ‘\M-a’ for Meta-A or ‘\M-\C-a’ for Control-Meta-A.

Characters

Lisp character constant syntax consists of a ‘?’ followed by either a character or an escape sequence starting with ‘\’. Examples: ?x, ?\n, ?\", ?\). Note that strings and characters are not interchangeable in Lisp; some contexts require one and some contexts require the other.

True

t stands for ‘true’.

False

nil stands for ‘false’.

Other Lisp objects

Write a single-quote (’) followed by the Lisp object you want.


Next: , Previous: , Up: Init File   [Contents][Index]