Next: Levels of Font Lock, Previous: Search-based Fontification, Up: Font Lock Mode
This section describes additional variables that a major mode
can set by means of font-lock-defaults
.
Non-
nil
means Font Lock should not fontify comments or strings syntactically; it should only fontify based onfont-lock-keywords
.
Non-
nil
means that regular expression matching for the sake offont-lock-keywords
should be case-insensitive.
This variable specifies the syntax table to use for fontification of comments and strings.
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
(i.e., the start of the line is known to be outside a syntactic block), orbeginning-of-defun
for programming modes orbackward-paragraph
for textual modes (i.e., the mode-dependent function is known to move outside a syntactic block).If the value is
nil
, the beginning of the buffer is used as a position outside of a syntactic block. This cannot be wrong, but it can be slow.
If this variable is non-
nil
, it should be a function that is called with no arguments, to choose an enclosing range of text for refontification for the command M-g M-g (font-lock-fontify-block
).The function should report its choice by placing the region around it. A good choice is a range of text large enough to give proper results, but not too large so that refontification becomes slow. Typical values are
mark-defun
for programming modes ormark-paragraph
for textual modes.