diff options
| author | Dave Love | 2003-04-24 16:16:56 +0000 |
|---|---|---|
| committer | Dave Love | 2003-04-24 16:16:56 +0000 |
| commit | f8cecb20b34ca9f262687efa67e7d4d709bd0b46 (patch) | |
| tree | 624f00ed8a0fb953671262ad19903196183f11f9 | |
| parent | 043dcdee035bc9a3c2f4d47b5487dd30b0297408 (diff) | |
| download | emacs-f8cecb20b34ca9f262687efa67e7d4d709bd0b46.tar.gz emacs-f8cecb20b34ca9f262687efa67e7d4d709bd0b46.zip | |
(font-lock-syntactic-keywords): Fix/expand description.
| -rw-r--r-- | lispref/modes.texi | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi index 201e9ad3dc6..6915c3424c4 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | @c -*-texinfo-*- | 1 | @c -*-texinfo-*- |
| 2 | @c This is part of the GNU Emacs Lisp Reference Manual. | 2 | @c This is part of the GNU Emacs Lisp Reference Manual. |
| 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 | 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2003 |
| 4 | @c Free Software Foundation, Inc. | 4 | @c Free Software Foundation, Inc. |
| 5 | @c See the file elisp.texi for copying conditions. | 5 | @c See the file elisp.texi for copying conditions. |
| 6 | @setfilename ../info/modes | 6 | @setfilename ../info/modes |
| @@ -2178,8 +2178,9 @@ automatically. This is useful in languages for which a single syntax | |||
| 2178 | table by itself is not sufficient. | 2178 | table by itself is not sufficient. |
| 2179 | 2179 | ||
| 2180 | @defvar font-lock-syntactic-keywords | 2180 | @defvar font-lock-syntactic-keywords |
| 2181 | This variable enables and controls syntactic Font Lock. Its value | 2181 | This variable enables and controls syntactic Font Lock. It is |
| 2182 | should be a list of elements of this form: | 2182 | normally set via @code{font-lock-defaults}. Its value should be a |
| 2183 | list of elements of this form: | ||
| 2183 | 2184 | ||
| 2184 | @example | 2185 | @example |
| 2185 | (@var{matcher} @var{subexp} @var{syntax} @var{override} @var{laxmatch}) | 2186 | (@var{matcher} @var{subexp} @var{syntax} @var{override} @var{laxmatch}) |
| @@ -2193,11 +2194,42 @@ sort of element of @code{font-lock-keywords}, | |||
| 2193 | @end example | 2194 | @end example |
| 2194 | 2195 | ||
| 2195 | However, instead of specifying the value @var{facename} to use for the | 2196 | However, instead of specifying the value @var{facename} to use for the |
| 2196 | @code{face} property, it specifies the value @var{syntax} to use for the | 2197 | @code{face} property, it specifies the value @var{syntax} to use for |
| 2197 | @code{syntax-table} property. Here, @var{syntax} can be a variable | 2198 | the @code{syntax-table} property. Here, @var{syntax} can be a string |
| 2198 | whose value is a syntax table, a syntax entry of the form | 2199 | (as taken by @code{modify-syntax-entry}), a syntax table, a cons cell |
| 2199 | @code{(@var{syntax-code} . @var{matching-char})}, or an expression whose | 2200 | (as returned by @code{string-to-syntax}), or an expression whose value |
| 2200 | value is one of those two types. | 2201 | is one of those two types. @var{override} cannot be @code{prepend} or |
| 2202 | @code{append}. | ||
| 2203 | |||
| 2204 | For example, an element of the form: | ||
| 2205 | |||
| 2206 | @example | ||
| 2207 | ("\\$\\(#\\)" 1 ".") | ||
| 2208 | @end example | ||
| 2209 | |||
| 2210 | highlights syntactically a hash character when following a dollar | ||
| 2211 | character, with a SYNTAX of @code{"."} (meaning punctuation syntax). | ||
| 2212 | Assuming that the buffer syntax table specifies hash characters to | ||
| 2213 | have comment start syntax, the element will only highlight hash | ||
| 2214 | characters that do not follow dollar characters as comments | ||
| 2215 | syntactically. | ||
| 2216 | |||
| 2217 | An element of the form: | ||
| 2218 | |||
| 2219 | @example | ||
| 2220 | ("\\('\\).\\('\\)" | ||
| 2221 | (1 "\"") | ||
| 2222 | (2 "\"")) | ||
| 2223 | @end example | ||
| 2224 | |||
| 2225 | highlights syntactically both single quotes which surround a single | ||
| 2226 | character, with a SYNTAX of @code{"\""} (meaning string quote syntax). | ||
| 2227 | Assuming that the buffer syntax table does not specify single quotes | ||
| 2228 | to have quote syntax, the element will only highlight single quotes of | ||
| 2229 | the form @samp{'@var{c}'} as strings syntactically. Other forms, such | ||
| 2230 | as @samp{foo'bar} or @samp{'fubar'}, will not be highlighted as | ||
| 2231 | strings. | ||
| 2232 | |||
| 2201 | @end defvar | 2233 | @end defvar |
| 2202 | 2234 | ||
| 2203 | @node Hooks | 2235 | @node Hooks |