aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2003-04-24 16:16:56 +0000
committerDave Love2003-04-24 16:16:56 +0000
commitf8cecb20b34ca9f262687efa67e7d4d709bd0b46 (patch)
tree624f00ed8a0fb953671262ad19903196183f11f9
parent043dcdee035bc9a3c2f4d47b5487dd30b0297408 (diff)
downloademacs-f8cecb20b34ca9f262687efa67e7d4d709bd0b46.tar.gz
emacs-f8cecb20b34ca9f262687efa67e7d4d709bd0b46.zip
(font-lock-syntactic-keywords): Fix/expand description.
-rw-r--r--lispref/modes.texi48
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
2178table by itself is not sufficient. 2178table by itself is not sufficient.
2179 2179
2180@defvar font-lock-syntactic-keywords 2180@defvar font-lock-syntactic-keywords
2181This variable enables and controls syntactic Font Lock. Its value 2181This variable enables and controls syntactic Font Lock. It is
2182should be a list of elements of this form: 2182normally set via @code{font-lock-defaults}. Its value should be a
2183list 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
2195However, instead of specifying the value @var{facename} to use for the 2196However, 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 2198the @code{syntax-table} property. Here, @var{syntax} can be a string
2198whose 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
2200value is one of those two types. 2201is one of those two types. @var{override} cannot be @code{prepend} or
2202@code{append}.
2203
2204For example, an element of the form:
2205
2206@example
2207("\\$\\(#\\)" 1 ".")
2208@end example
2209
2210highlights syntactically a hash character when following a dollar
2211character, with a SYNTAX of @code{"."} (meaning punctuation syntax).
2212Assuming that the buffer syntax table specifies hash characters to
2213have comment start syntax, the element will only highlight hash
2214characters that do not follow dollar characters as comments
2215syntactically.
2216
2217An element of the form:
2218
2219@example
2220 ("\\('\\).\\('\\)"
2221 (1 "\"")
2222 (2 "\""))
2223@end example
2224
2225highlights syntactically both single quotes which surround a single
2226character, with a SYNTAX of @code{"\""} (meaning string quote syntax).
2227Assuming that the buffer syntax table does not specify single quotes
2228to have quote syntax, the element will only highlight single quotes of
2229the form @samp{'@var{c}'} as strings syntactically. Other forms, such
2230as @samp{foo'bar} or @samp{'fubar'}, will not be highlighted as
2231strings.
2232
2201@end defvar 2233@end defvar
2202 2234
2203@node Hooks 2235@node Hooks