aboutsummaryrefslogtreecommitdiffstats
path: root/lispref/modes.texi
diff options
context:
space:
mode:
authorLute Kamstra2005-04-28 11:32:54 +0000
committerLute Kamstra2005-04-28 11:32:54 +0000
commit4f45f65edf4ddc7ecc703ec656d93b515a796598 (patch)
tree2af3244ba5d4fcd4df44774b9a9206f85c2a9eab /lispref/modes.texi
parentd79b6c21bdfa03ede3b00c7c3d90789300bb1695 (diff)
downloademacs-4f45f65edf4ddc7ecc703ec656d93b515a796598.tar.gz
emacs-4f45f65edf4ddc7ecc703ec656d93b515a796598.zip
(Defining Minor Modes): Fix previous change.
(Font Lock Mode): Simplify. (Font Lock Basics): Say that font-lock-defaults is buffer-local when set and that some parts are optional. Add cross references. (Search-based Fontification): Say how to specify font-lock-keywords. Add cross references. Add font-lock-multiline to index. Move font-lock-keywords-case-fold-search here from node "Other Font Lock Variables". Document font-lock-add-keywords and font-lock-remove-keywords (Other Font Lock Variables): Move font-lock-keywords-only, font-lock-syntax-table, font-lock-beginning-of-syntax-function, and font-lock-syntactic-face-function to node "Syntactic Font Lock". Move font-lock-keywords-case-fold-search to node "Search-based Fontification". Document font-lock-inhibit-thing-lock and font-lock-{,un}fontify-{buffer,region}-function. (Precalculated Fontification): Remove reference to deleted variable font-lock-core-only. (Faces for Font Lock): Add font-lock-comment-delimiter-face. (Syntactic Font Lock): Add intro. Move font-lock-keywords-only, font-lock-syntax-table, font-lock-beginning-of-syntax-function, and font-lock-syntactic-face-function here from node "Other Font Lock Variables". Move font-lock-syntactic-keywords to "Setting Syntax Properties". Add cross references. (Setting Syntax Properties): New node. Move font-lock-syntactic-keywords here from "Syntactic Font Lock".
Diffstat (limited to 'lispref/modes.texi')
-rw-r--r--lispref/modes.texi318
1 files changed, 216 insertions, 102 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 4c7d1130267..e0494d4e7d9 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -1134,9 +1134,10 @@ corresponding values. A few keywords have special meanings:
1134@table @code 1134@table @code
1135@item :group @var{group} 1135@item :group @var{group}
1136Custom group name to use in all generated @code{defcustom} forms. 1136Custom group name to use in all generated @code{defcustom} forms.
1137Defaults to @var{mode} without the possible trailing @samp{-mode}. Be 1137Defaults to @var{mode} without the possible trailing @samp{-mode}.
1138aware that this default may not be a valid customization group defined 1138@strong{Warning:} don't use this default group name unless you have
1139with @code{defgroup}. Please make sure it is. 1139written a @code{defgroup} to define that group properly. @xref{Group
1140Definitions}.
1140 1141
1141@item :global @var{global} 1142@item :global @var{global}
1142If non-@code{nil} specifies that the minor mode should be global. 1143If non-@code{nil} specifies that the minor mode should be global.
@@ -2025,12 +2026,11 @@ most major modes define syntactic criteria for which faces to use in
2025which contexts. This section explains how to customize Font Lock for a 2026which contexts. This section explains how to customize Font Lock for a
2026particular major mode. 2027particular major mode.
2027 2028
2028 Font Lock mode finds text to highlight in two ways: through syntactic 2029 Font Lock mode finds text to highlight in two ways: through
2029parsing based on the syntax table, and through searching (usually for 2030syntactic parsing based on the syntax table, and through searching
2030regular expressions). Syntactic fontification happens first; it finds 2031(usually for regular expressions). Syntactic fontification happens
2031comments and string constants, and highlights them using 2032first; it finds comments and string constants and highlights them.
2032@code{font-lock-comment-face} and @code{font-lock-string-face} 2033Search-based fontification happens second.
2033(@pxref{Faces for Font Lock}). Search-based fontification follows.
2034 2034
2035@menu 2035@menu
2036* Font Lock Basics:: Overview of customizing Font Lock. 2036* Font Lock Basics:: Overview of customizing Font Lock.
@@ -2041,7 +2041,8 @@ comments and string constants, and highlights them using
2041* Precalculated Fontification:: How Lisp programs that produce the buffer 2041* Precalculated Fontification:: How Lisp programs that produce the buffer
2042 contents can also specify how to fontify it. 2042 contents can also specify how to fontify it.
2043* Faces for Font Lock:: Special faces specifically for Font Lock. 2043* Faces for Font Lock:: Special faces specifically for Font Lock.
2044* Syntactic Font Lock:: Defining character syntax based on context 2044* Syntactic Font Lock:: Fontification based on syntax tables.
2045* Setting Syntax Properties:: Defining character syntax based on context
2045 using the Font Lock mechanism. 2046 using the Font Lock mechanism.
2046@end menu 2047@end menu
2047 2048
@@ -2056,45 +2057,48 @@ Lock mode is enabled, to set all the other variables.
2056 2057
2057@defvar font-lock-defaults 2058@defvar font-lock-defaults
2058This variable is set by major modes, as a buffer-local variable, to 2059This variable is set by major modes, as a buffer-local variable, to
2059specify how to fontify text in that mode. The value should look like 2060specify how to fontify text in that mode. It automatically becomes
2060this: 2061buffer-local when you set it. The value should look like this:
2061 2062
2062@example 2063@example
2063(@var{keywords} @var{keywords-only} @var{case-fold} 2064(@var{keywords} [@var{keywords-only} [@var{case-fold}
2064 @var{syntax-alist} @var{syntax-begin} @var{other-vars}@dots{}) 2065 [@var{syntax-alist} [@var{syntax-begin} @var{other-vars}@dots{}]]]])
2065@end example 2066@end example
2066 2067
2067The first element, @var{keywords}, indirectly specifies the value of 2068The first element, @var{keywords}, indirectly specifies the value of
2068@code{font-lock-keywords}. It can be a symbol, a variable whose value 2069@code{font-lock-keywords} which directs search-based fontification.
2069is the list to use for @code{font-lock-keywords}. It can also be a list of 2070It can be a symbol, a variable or a function whose value is the list
2070several such symbols, one for each possible level of fontification. The 2071to use for @code{font-lock-keywords}. It can also be a list of
2071first symbol specifies how to do level 1 fontification, the second 2072several such symbols, one for each possible level of fontification.
2072symbol how to do level 2, and so on. 2073The first symbol specifies how to do level 1 fontification, the second
2074symbol how to do level 2, and so on. @xref{Levels of Font Lock}.
2073 2075
2074The second element, @var{keywords-only}, specifies the value of the 2076The second element, @var{keywords-only}, specifies the value of the
2075variable @code{font-lock-keywords-only}. If this is non-@code{nil}, 2077variable @code{font-lock-keywords-only}. If this is non-@code{nil},
2076syntactic fontification (of strings and comments) is not performed. 2078syntactic fontification (of strings and comments) is not performed.
2079@xref{Syntactic Font Lock}.
2077 2080
2078The third element, @var{case-fold}, specifies the value of 2081The third element, @var{case-fold}, specifies the value of
2079@code{font-lock-keywords-case-fold-search}. If it is non-@code{nil}, Font Lock 2082@code{font-lock-keywords-case-fold-search}. If it is non-@code{nil},
2080mode ignores case when searching as directed by 2083Font Lock mode ignores case when searching as directed by
2081@code{font-lock-keywords}. 2084@code{font-lock-keywords}.
2082 2085
2083If the fourth element, @var{syntax-alist}, is non-@code{nil}, it should be 2086If the fourth element, @var{syntax-alist}, is non-@code{nil}, it
2084a list of cons cells of the form @code{(@var{char-or-string} 2087should be a list of cons cells of the form @code{(@var{char-or-string}
2085. @var{string})}. These are used to set up a syntax table for 2088. @var{string})}. These are used to set up a syntax table for
2086fontification (@pxref{Syntax Table Functions}). The resulting syntax 2089syntactic fontification (@pxref{Syntax Table Functions}). The
2087table is stored in @code{font-lock-syntax-table}. 2090resulting syntax table is stored in @code{font-lock-syntax-table}.
2088 2091
2089The fifth element, @var{syntax-begin}, specifies the value of 2092The fifth element, @var{syntax-begin}, specifies the value of
2090@code{font-lock-beginning-of-syntax-function} (see below). 2093@code{font-lock-beginning-of-syntax-function}.
2091 2094
2092All the remaining elements (if any) are collectively called 2095All the remaining elements (if any) are collectively called
2093@var{other-vars}. Each of these elements should have the form 2096@var{other-vars}. Each of these elements should have the form
2094@code{(@var{variable} . @var{value})}---which means, make @var{variable} 2097@code{(@var{variable} . @var{value})}---which means, make
2095buffer-local and then set it to @var{value}. You can use these 2098@var{variable} buffer-local and then set it to @var{value}. You can
2096@var{other-vars} to set other variables that affect fontification, 2099use these @var{other-vars} to set other variables that affect
2097aside from those you can control with the first five elements. 2100fontification, aside from those you can control with the first five
2101elements. @xref{Other Font Lock Variables}.
2098@end defvar 2102@end defvar
2099 2103
2100@node Search-based Fontification 2104@node Search-based Fontification
@@ -2102,7 +2106,8 @@ aside from those you can control with the first five elements.
2102 2106
2103 The most important variable for customizing Font Lock mode is 2107 The most important variable for customizing Font Lock mode is
2104@code{font-lock-keywords}. It specifies the search criteria for 2108@code{font-lock-keywords}. It specifies the search criteria for
2105search-based fontification. 2109search-based fontification. You should specify the value of this
2110variable with @var{keywords} in @code{font-lock-defaults}.
2106 2111
2107@defvar font-lock-keywords 2112@defvar font-lock-keywords
2108This variable's value is a list of the keywords to highlight. Be 2113This variable's value is a list of the keywords to highlight. Be
@@ -2192,7 +2197,8 @@ other text property names that you set in this way to the value of
2192@code{font-lock-extra-managed-props} so that the properties will also 2197@code{font-lock-extra-managed-props} so that the properties will also
2193be cleared out when they are no longer appropriate. Alternatively, 2198be cleared out when they are no longer appropriate. Alternatively,
2194you can set the variable @code{font-lock-unfontify-region-function} to 2199you can set the variable @code{font-lock-unfontify-region-function} to
2195a function that clears these properties. 2200a function that clears these properties. @xref{Other Font Lock
2201Variables}.
2196 2202
2197@item (@var{matcher} . @var{subexp-highlighter}) 2203@item (@var{matcher} . @var{subexp-highlighter})
2198In this kind of element, @var{subexp-highlighter} is a list 2204In this kind of element, @var{subexp-highlighter} is a list
@@ -2312,6 +2318,7 @@ this value of @code{font-lock-keywords} is used in a buffer.
2312Its value should have one of the forms described in this table. 2318Its value should have one of the forms described in this table.
2313@end table 2319@end table
2314 2320
2321@vindex font-lock-multiline
2315@strong{Warning:} Do not design an element of @code{font-lock-keywords} 2322@strong{Warning:} Do not design an element of @code{font-lock-keywords}
2316to match text which spans lines; this does not work reliably. While 2323to match text which spans lines; this does not work reliably. While
2317@code{font-lock-fontify-buffer} handles multi-line patterns correctly, 2324@code{font-lock-fontify-buffer} handles multi-line patterns correctly,
@@ -2322,52 +2329,75 @@ line but can occasionally span two or three, such as
2322setting @code{font-lock-multiline} to @code{t}. But it still will not 2329setting @code{font-lock-multiline} to @code{t}. But it still will not
2323work in all cases. 2330work in all cases.
2324 2331
2325@node Other Font Lock Variables 2332You can use @var{case-fold} in @code{font-lock-defaults} to specify
2326@subsection Other Font Lock Variables 2333the value of @code{font-lock-keywords-case-fold-search} which says
2327 2334whether search-based fontification should be case-insensitive.
2328 This section describes additional variables that a major mode
2329can set by means of @code{font-lock-defaults}.
2330
2331@defvar font-lock-keywords-only
2332Non-@code{nil} means Font Lock should not fontify comments or strings
2333syntactically; it should only fontify based on
2334@code{font-lock-keywords}.
2335@end defvar
2336
2337@ignore
2338Other variables include those for buffer-specialized fontification functions,
2339`font-lock-fontify-buffer-function', `font-lock-unfontify-buffer-function',
2340`font-lock-fontify-region-function', `font-lock-unfontify-region-function',
2341`font-lock-inhibit-thing-lock' and `font-lock-maximum-size'.
2342@end ignore
2343 2335
2344@defvar font-lock-keywords-case-fold-search 2336@defvar font-lock-keywords-case-fold-search
2345Non-@code{nil} means that regular expression matching for the sake of 2337Non-@code{nil} means that regular expression matching for the sake of
2346@code{font-lock-keywords} should be case-insensitive. 2338@code{font-lock-keywords} should be case-insensitive.
2347@end defvar 2339@end defvar
2348 2340
2349@defvar font-lock-syntax-table 2341You can use @code{font-lock-add-keywords} to add additional
2350This variable specifies the syntax table to use for fontification of 2342search-based fontification rules to a major mode, and
2351comments and strings. 2343@code{font-lock-remove-keywords} to removes rules.
2352@end defvar 2344
2345@defun font-lock-add-keywords mode keywords &optional append
2346This function adds highlighting @var{keywords} for @var{mode}. The
2347argument @var{keywords} should be a list with the same format as the
2348variable @code{font-lock-keywords}. @var{mode} should be a symbol,
2349the major mode command name, such as @code{c-mode}. When Font Lock
2350mode is turned on in @var{mode}, it adds @var{keywords} to
2351@code{font-lock-keywords}. @var{mode} can also be @code{nil}; the
2352highlighting @var{keywords} are immediately added to
2353@code{font-lock-keywords} in the current buffer in that case.
2354
2355By default, @var{keywords} are added at the beginning of
2356@code{font-lock-keywords}. If the optional argument @var{append} is
2357@code{set}, they are used to replace the value of
2358@code{font-lock-keywords}. If @var{append} is any other
2359non-@code{nil} value, they are added at the end of
2360@code{font-lock-keywords}.
2353 2361
2354@defvar font-lock-beginning-of-syntax-function 2362For example:
2355If this variable is non-@code{nil}, it should be a function to move
2356point back to a position that is syntactically at ``top level'' and
2357outside of strings or comments. Font Lock uses this when necessary
2358to get the right results for syntactic fontification.
2359 2363
2360This function is called with no arguments. It should leave point at the 2364@smallexample
2361beginning of any enclosing syntactic block. Typical values are 2365(font-lock-add-keywords 'c-mode
2362@code{beginning-of-line} (i.e., the start of the line is known to be 2366 '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
2363outside a syntactic block), or @code{beginning-of-defun} for programming 2367 ("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face)))
2364modes or @code{backward-paragraph} for textual modes (i.e., the 2368@end smallexample
2365mode-dependent function is known to move outside a syntactic block).
2366 2369
2367If the value is @code{nil}, the beginning of the buffer is used as a 2370adds two fontification patterns for C mode: one to fontify the word
2368position outside of a syntactic block. This cannot be wrong, but it can 2371@samp{FIXME}, even in comments, and another to fontify the words
2369be slow. 2372@samp{and}, @samp{or} and @samp{not} as keywords.
2370@end defvar 2373
2374Some modes have specialized support for additional patterns. See the
2375variables @code{c-font-lock-extra-types},
2376@code{c++-font-lock-extra-types}, @code{objc-font-lock-extra-types}
2377and @code{java-font-lock-extra-types}, for example.
2378@end defun
2379
2380@defun font-lock-remove-keywords mode keywords
2381This function removes highlighting @var{keywords} for @var{mode}. As
2382in @code{font-lock-add-keywords}, @var{mode} should be a major mode
2383command name or @code{nil}. If @code{nil}, the highlighting
2384@var{keywords} are immediately removed in the current buffer.
2385@end defun
2386
2387@strong{Warning:} Only use a non-@code{nil} @var{mode} argument when
2388you use @code{font-lock-add-keywords} or
2389@code{font-lock-remove-keywords} in your @file{.emacs} file. When you
2390use these functions from a Lisp program (such as a minor mode), we
2391recommend that you use @code{nil} for @var{mode} (and place the call
2392on a hook) to avoid subtle problems due to the details of the
2393implementation.
2394
2395@node Other Font Lock Variables
2396@subsection Other Font Lock Variables
2397
2398 This section describes additional variables that a major mode can
2399set by means of @var{other-vars} in @code{font-lock-defaults}
2400(@pxref{Font Lock Basics}).
2371 2401
2372@defvar font-lock-mark-block-function 2402@defvar font-lock-mark-block-function
2373If this variable is non-@code{nil}, it should be a function that is 2403If this variable is non-@code{nil}, it should be a function that is
@@ -2383,25 +2413,38 @@ textual modes.
2383@end defvar 2413@end defvar
2384 2414
2385@defvar font-lock-extra-managed-props 2415@defvar font-lock-extra-managed-props
2386Additional properties (other than @code{font-lock-face}) that are 2416This variable specifies additional properties (other than
2387being managed by Font Lock mode. Font Lock mode normally manages only 2417@code{font-lock-face}) that are being managed by Font Lock mode. It
2388the @code{font-lock-face} property; if you want it to manage others as 2418is used by @code{font-lock-default-unfontify-region}, which normally
2389well, you must specify them in a @var{facespec} in 2419only manages the @code{font-lock-face} property. If you want Font
2390@code{font-lock-keywords} as well as adding them to this list. 2420Lock to manage other properties as well, you must specify them in a
2421@var{facespec} in @code{font-lock-keywords} as well as add them to
2422this list. @xref{Search-based Fontification}.
2391@end defvar 2423@end defvar
2392 2424
2393@defvar font-lock-syntactic-face-function 2425@defvar font-lock-fontify-buffer-function
2394A function to determine which face to use for a given syntactic 2426Function to use for fontifying the buffer. The default value is
2395element (a string or a comment). The function is called with one 2427@code{font-lock-default-fontify-buffer}.
2396argument, the parse state at point returned by 2428@end defvar
2397@code{parse-partial-sexp}, and should return a face. The default
2398value returns @code{font-lock-comment-face} for comments and
2399@code{font-lock-string-face} for strings.
2400 2429
2401This can be used to highlighting different kinds of strings or 2430@defvar font-lock-unfontify-buffer-function
2402comments differently. It is also sometimes abused together with 2431Function to use for unfontifying the buffer. This is used when
2403@code{font-lock-syntactic-keywords} to highlight elements that span 2432turning off Font Lock mode. The default value is
2404multiple lines, but this is too obscure to document in this manual. 2433@code{font-lock-default-unfontify-buffer}.
2434@end defvar
2435
2436@defvar font-lock-fontify-region-function
2437Function to use for fontifying a region. It should take two
2438arguments, the beginning and end of the region, and an optional third
2439argument @var{verbose}. If @var{verbose} is non-@code{nil}, the
2440function should print status messages. The default value is
2441@code{font-lock-default-fontify-region}.
2442@end defvar
2443
2444@defvar font-lock-unfontify-region-function
2445Function to use for unfontifying a region. It should take two
2446arguments, the beginning and end of the region. The default value is
2447@code{font-lock-default-unfontify-region}.
2405@end defvar 2448@end defvar
2406 2449
2407@defvar font-lock-lines-before 2450@defvar font-lock-lines-before
@@ -2412,6 +2455,14 @@ default is 1, but using a larger value can be useful for coping with
2412multi-line patterns. 2455multi-line patterns.
2413@end defvar 2456@end defvar
2414 2457
2458@ignore
2459@defvar font-lock-inhibit-thing-lock
2460List of Font Lock mode related modes that should not be turned on.
2461Currently, valid mode names are @code{fast-lock-mode},
2462@code{jit-lock-mode} and @code{lazy-lock-mode}.
2463@end defvar
2464@end ignore
2465
2415@node Levels of Font Lock 2466@node Levels of Font Lock
2416@subsection Levels of Font Lock 2467@subsection Levels of Font Lock
2417 2468
@@ -2456,16 +2507,9 @@ which construct their text programmatically, such as
2456@code{list-buffers} and @code{occur}. 2507@code{list-buffers} and @code{occur}.
2457 2508
2458If your mode does not use any of the other machinery of Font Lock 2509If your mode does not use any of the other machinery of Font Lock
2459(i.e. it only uses the @code{font-lock-face} property), you can tell 2510(i.e. it only uses the @code{font-lock-face} property), it should not
2460Emacs not to load all of font-lock.el (unless it's already loaded), by 2511set the variable @code{font-lock-defaults}. That way, it will not
2461setting the variable @code{font-lock-core-only} to non-@code{nil} as 2512cause loading of the @file{font-lock} library.
2462part of the @code{font-lock-defaults} settings. Here is the canonical
2463way to do this:
2464
2465@example
2466(set (make-local-variable 'font-lock-defaults)
2467 '(nil t nil nil nil (font-lock-core-only . t)))
2468@end example
2469 2513
2470@node Faces for Font Lock 2514@node Faces for Font Lock
2471@subsection Faces for Font Lock 2515@subsection Faces for Font Lock
@@ -2483,6 +2527,10 @@ Thus, the default value of @code{font-lock-comment-face} is
2483@vindex font-lock-comment-face 2527@vindex font-lock-comment-face
2484Used (typically) for comments. 2528Used (typically) for comments.
2485 2529
2530@item font-lock-comment-delimiter-face
2531@vindex font-lock-comment-delimiter-face
2532Used (typically) for comments delimiters.
2533
2486@item font-lock-doc-face 2534@item font-lock-doc-face
2487@vindex font-lock-doc-face 2535@vindex font-lock-doc-face
2488Used (typically) for documentation strings in the code. 2536Used (typically) for documentation strings in the code.
@@ -2534,14 +2582,78 @@ directives in C.
2534@node Syntactic Font Lock 2582@node Syntactic Font Lock
2535@subsection Syntactic Font Lock 2583@subsection Syntactic Font Lock
2536 2584
2585Syntactic fontification uses the syntax table to find comments and
2586string constants (@pxref{Syntax Tables}). It highlights them using
2587@code{font-lock-comment-face} and @code{font-lock-string-face}
2588(@pxref{Faces for Font Lock}). There are several variables that
2589affect syntactic fontification; you should set them by means of
2590@code{font-lock-defaults} (@pxref{Font Lock Basics}).
2591
2592@defvar font-lock-keywords-only
2593Non-@code{nil} means Font Lock should not do syntactic fontification;
2594it should only fontify based on @code{font-lock-keywords}. The normal
2595way for a mode to set this variable to @code{t} is with
2596@var{keywords-only} in @code{font-lock-defaults}.
2597@end defvar
2598
2599@defvar font-lock-syntax-table
2600This variable holds the syntax table to use for fontification of
2601comments and strings. Specify it using @var{syntax-alist} in
2602@code{font-lock-defaults}.
2603@end defvar
2604
2605@c ???
2606@c The docstring says that font-lock-syntax-table is semi-obsolete.
2607@c How the alternative should be used is not clear. --lute
2608
2609@defvar font-lock-beginning-of-syntax-function
2610If this variable is non-@code{nil}, it should be a function to move
2611point back to a position that is syntactically at ``top level'' and
2612outside of strings or comments. Font Lock uses this when necessary
2613to get the right results for syntactic fontification.
2614
2615This function is called with no arguments. It should leave point at
2616the beginning of any enclosing syntactic block. Typical values are
2617@code{beginning-of-line} (used when the start of the line is known to
2618be outside a syntactic block), or @code{beginning-of-defun} for
2619programming modes, or @code{backward-paragraph} for textual modes.
2620
2621If the value is @code{nil}, the beginning of the buffer is used as a
2622position outside of a syntactic block. This cannot be wrong, but it
2623can be slow.
2624
2625Specify this variable using @var{syntax-begin} in
2626@code{font-lock-defaults}.
2627@end defvar
2628
2629@defvar font-lock-syntactic-face-function
2630A function to determine which face to use for a given syntactic
2631element (a string or a comment). The function is called with one
2632argument, the parse state at point returned by
2633@code{parse-partial-sexp}, and should return a face. The default
2634value returns @code{font-lock-comment-face} for comments and
2635@code{font-lock-string-face} for strings.
2636
2637This can be used to highlighting different kinds of strings or
2638comments differently. It is also sometimes abused together with
2639@code{font-lock-syntactic-keywords} to highlight elements that span
2640multiple lines, but this is too obscure to document in this manual.
2641
2642Specify this variable using @var{other-vars} in
2643@code{font-lock-defaults}.
2644@end defvar
2645
2646@node Setting Syntax Properties
2647@subsection Setting Syntax Properties
2648
2537 Font Lock mode can be used to update @code{syntax-table} properties 2649 Font Lock mode can be used to update @code{syntax-table} properties
2538automatically. This is useful in languages for which a single syntax 2650automatically (@pxref{Syntax Properties}). This is useful in
2539table by itself is not sufficient. 2651languages for which a single syntax table by itself is not sufficient.
2540 2652
2541@defvar font-lock-syntactic-keywords 2653@defvar font-lock-syntactic-keywords
2542This variable enables and controls syntactic Font Lock. It is 2654This variable enables and controls updating @code{syntax-table}
2543normally set via @code{font-lock-defaults}. Its value should be a 2655properties by Font Lock. Its value should be a list of elements of
2544list of elements of this form: 2656this form:
2545 2657
2546@example 2658@example
2547(@var{matcher} @var{subexp} @var{syntax} @var{override} @var{laxmatch}) 2659(@var{matcher} @var{subexp} @var{syntax} @var{override} @var{laxmatch})
@@ -2551,10 +2663,10 @@ The parts of this element have the same meanings as in the corresponding
2551sort of element of @code{font-lock-keywords}, 2663sort of element of @code{font-lock-keywords},
2552 2664
2553@example 2665@example
2554(@var{matcher} @var{subexp} @var{facename} @var{override} @var{laxmatch}) 2666(@var{matcher} @var{subexp} @var{facespec} @var{override} @var{laxmatch})
2555@end example 2667@end example
2556 2668
2557However, instead of specifying the value @var{facename} to use for the 2669However, instead of specifying the value @var{facespec} to use for the
2558@code{face} property, it specifies the value @var{syntax} to use for 2670@code{face} property, it specifies the value @var{syntax} to use for
2559the @code{syntax-table} property. Here, @var{syntax} can be a string 2671the @code{syntax-table} property. Here, @var{syntax} can be a string
2560(as taken by @code{modify-syntax-entry}), a syntax table, a cons cell 2672(as taken by @code{modify-syntax-entry}), a syntax table, a cons cell
@@ -2591,6 +2703,8 @@ the form @samp{'@var{c}'} as strings syntactically. Other forms, such
2591as @samp{foo'bar} or @samp{'fubar'}, will not be highlighted as 2703as @samp{foo'bar} or @samp{'fubar'}, will not be highlighted as
2592strings. 2704strings.
2593 2705
2706Major modes normally set this variable with @var{other-vars} in
2707@code{font-lock-defaults}.
2594@end defvar 2708@end defvar
2595 2709
2596@node Desktop Save Mode 2710@node Desktop Save Mode