Syntactic fontification uses the syntax table to find comments and
string constants (see Syntax Tables). It highlights them using
(see Faces for Font Lock), or whatever
font-lock-syntactic-face-function chooses. There are several
variables that affect syntactic fontification; you should set them by
font-lock-defaults (see Font Lock Basics).
nilmeans Font Lock should not do syntactic fontification; it should only fontify based on
font-lock-keywords. The normal way for a mode to set this variable to
tis with keywords-only in
This variable holds the syntax table to use for fontification of comments and strings. Specify it using syntax-alist in
font-lock-defaults. If this is
nil, fontification uses the buffer's syntax table.
If this variable is non-
nil, it should be a function to move point back to a position that is syntactically at “top level” and outside of strings or comments. Font Lock uses this when necessary to get the right results for syntactic fontification.
This function is called with no arguments. It should leave point at the beginning of any enclosing syntactic block. Typical values are
beginning-of-line(used when the start of the line is known to be outside a syntactic block), or
beginning-of-defunfor programming modes, or
backward-paragraphfor textual modes.
If the value is
nil, Font Lock uses
syntax-begin-functionto move back outside of any comment, string, or sexp. This variable is semi-obsolete; we recommend setting
Specify this variable using syntax-begin in
A function to determine which face to use for a given syntactic element (a string or a comment). The function is called with one argument, the parse state at point returned by
parse-partial-sexp, and should return a face. The default value returns
font-lock-comment-facefor comments and
This can be used to highlighting different kinds of strings or comments differently. It is also sometimes abused together with
font-lock-syntactic-keywordsto highlight constructs that span multiple lines, but this is too esoteric to document here.
Specify this variable using other-vars in