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

AD.6 The Syntax Table

All the Emacs commands which parse words or balance parentheses are controlled by the syntax table. The syntax table says which characters are opening delimiters, which are parts of words, which are string quotes, and so on. It does this by assigning each character to one of fifteen-odd syntax classes. In some cases it specifies some additional information also.

Each major mode has its own syntax table (though related major modes sometimes share one syntax table) which it installs in each buffer that uses the mode. The syntax table installed in the current buffer is the one that all commands use, so we call it "the" syntax table.

To display a description of the contents of the current syntax table, type C-h s (describe-syntax). The description of each character includes both the string you would have to give to modify-syntax-entry to set up that character's current syntax, starting with the character which designates its syntax class, plus some English text to explain its meaning.

A syntax table is actually a Lisp object, a char-table, whose elements are cons cells. For full information on the syntax table, see section `Syntax Tables' in The Emacs Lisp Reference Manual.



This document was generated on April 2, 2002 using texi2html