diff options
Diffstat (limited to 'devdocs/elisp/syntax-descriptors.html')
| -rw-r--r-- | devdocs/elisp/syntax-descriptors.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/devdocs/elisp/syntax-descriptors.html b/devdocs/elisp/syntax-descriptors.html new file mode 100644 index 00000000..c3650851 --- /dev/null +++ b/devdocs/elisp/syntax-descriptors.html @@ -0,0 +1,16 @@ + <h3 class="section">Syntax Descriptors</h3> <p>The <em>syntax class</em> of a character describes its syntactic role. Each syntax table specifies the syntax class of each character. There is no necessary relationship between the class of a character in one syntax table and its class in any other table. </p> <p>Each syntax class is designated by a mnemonic character, which serves as the name of the class when you need to specify a class. Usually, this designator character is one that is often assigned that class; however, its meaning as a designator is unvarying and independent of what syntax that character currently has. Thus, ‘<samp>\</samp>’ as a designator character always stands for escape character syntax, regardless of whether the ‘<samp>\</samp>’ character actually has that syntax in the current syntax table. See <a href="syntax-class-table">Syntax Class Table</a>, for a list of syntax classes and their designator characters. </p> <p>A <em>syntax descriptor</em> is a Lisp string that describes the syntax class and other syntactic properties of a character. When you want to modify the syntax of a character, that is done by calling the function <code>modify-syntax-entry</code> and passing a syntax descriptor as one of its arguments (see <a href="syntax-table-functions">Syntax Table Functions</a>). </p> <p>The first character in a syntax descriptor must be a syntax class designator character. The second character, if present, specifies a matching character (e.g., in Lisp, the matching character for ‘<samp>(</samp>’ is ‘<samp>)</samp>’); a space specifies that there is no matching character. Then come characters specifying additional syntax properties (see <a href="syntax-flags">Syntax Flags</a>). </p> <p>If no matching character or flags are needed, only one character (specifying the syntax class) is sufficient. </p> <p>For example, the syntax descriptor for the character ‘<samp>*</samp>’ in C mode is <code>". 23"</code> (i.e., punctuation, matching character slot unused, second character of a comment-starter, first character of a comment-ender), and the entry for ‘<samp>/</samp>’ is ‘<samp>. 14</samp>’ (i.e., punctuation, matching character slot unused, first character of a comment-starter, second character of a comment-ender). </p> <p>Emacs also defines <em>raw syntax descriptors</em>, which are used to describe syntax classes at a lower level. See <a href="syntax-table-internals">Syntax Table Internals</a>. </p> <table class="menu" border="0" cellspacing="0"> <tr> +<td align="left" valign="top">• <a href="syntax-class-table" accesskey="1">Syntax Class Table</a> +</td> +<td> </td> +<td align="left" valign="top">Table of syntax classes. </td> +</tr> <tr> +<td align="left" valign="top">• <a href="syntax-flags" accesskey="2">Syntax Flags</a> +</td> +<td> </td> +<td align="left" valign="top">Additional flags each character can have. </td> +</tr> </table><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Descriptors.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Descriptors.html</a> + </p> +</div> |
