Next: Multiline Font Lock, Previous: Syntactic Font Lock, Up: Font Lock Mode
Font Lock mode can be used to update syntax-table properties
automatically (see Syntax Properties). This is useful in
languages for which a single syntax table by itself is not sufficient.
This variable enables and controls updating
syntax-tableproperties by Font Lock. Its value should be a list of elements of this form:(matcher subexp syntax override laxmatch)The parts of this element have the same meanings as in the corresponding sort of element of
font-lock-keywords,(matcher subexp facespec override laxmatch)However, instead of specifying the value facespec to use for the
faceproperty, it specifies the value syntax to use for thesyntax-tableproperty. Here, syntax can be a string (as taken bymodify-syntax-entry), a syntax table, a cons cell (as returned bystring-to-syntax), or an expression whose value is one of those two types. override cannot beprependorappend.For example, an element of the form:
("\\$\\(#\\)" 1 ".")highlights syntactically a hash character when following a dollar character, with a SYNTAX of
"."(meaning punctuation syntax). Assuming that the buffer syntax table specifies hash characters to have comment start syntax, the element will only highlight hash characters that do not follow dollar characters as comments syntactically.An element of the form:
("\\('\\).\\('\\)" (1 "\"") (2 "\""))highlights syntactically both single quotes which surround a single character, with a SYNTAX of
"\""(meaning string quote syntax). Assuming that the buffer syntax table does not specify single quotes to have quote syntax, the element will only highlight single quotes of the form `'c'' as strings syntactically. Other forms, such as `foo'bar' or `'fubar'', will not be highlighted as strings.Major modes normally set this variable with other-vars in
font-lock-defaults.