1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Merge from origin/emacs-30

0974418f2a Improve and correct documentation of 'font-lock-keywords-...
This commit is contained in:
Eli Zaretskii 2025-11-01 05:28:54 -04:00
commit e1b64c8b12
2 changed files with 16 additions and 11 deletions

View file

@ -4118,16 +4118,17 @@ table in special cases. @xref{Syntax Properties}.
@defvar font-lock-keywords-only @defvar font-lock-keywords-only
If the value of this variable is non-@code{nil}, Font Lock does not do If the value of this variable is non-@code{nil}, Font Lock does not do
syntactic fontification, only search-based fontification based on syntactic fontification, only search-based fontification based on
@code{font-lock-keywords}. It is normally set by Font Lock mode based @code{font-lock-keywords}; this will usually have the effect of not
on the @var{keywords-only} element in @code{font-lock-defaults}. If fontifying comments and strings. This variable is normally set by Font
the value is @code{nil}, Font Lock will call @code{jit-lock-register} Lock mode based on the @var{keywords-only} element in
(@pxref{Other Font Lock Variables}) to set up for automatic @code{font-lock-defaults}. If the value is @code{nil}, Font Lock will
refontification of buffer text following a modified line to reflect call @code{jit-lock-register} (@pxref{Other Font Lock Variables}) to set
the new syntactic context due to the change. up for automatic refontification of buffer text following a modified
line to reflect the new syntactic context due to the change.
To use only syntactic fontification, this variable should To use only syntactic fontification, both this variable and
be non-@code{nil}, while @code{font-lock-keywords} should be set to @code{font-lock-keywords} should be set to @code{nil} (@pxref{Font Lock
@code{nil} (@pxref{Font Lock Basics}). Basics}).
@end defvar @end defvar
@defvar font-lock-syntax-table @defvar font-lock-syntax-table

View file

@ -560,8 +560,12 @@ This is normally set via `font-lock-add-keywords' and
`font-lock-remove-keywords'.") `font-lock-remove-keywords'.")
(defvar font-lock-keywords-only nil (defvar font-lock-keywords-only nil
"Non-nil means Font Lock should not fontify comments or strings. "Non-nil means Font Lock should not use syntactic fontifications.
This is normally set via `font-lock-defaults'.") This is normally set via `font-lock-defaults'. Setting it to a
non-nil value will usually cause comments and strings not to be
fontified, unless `font-lock-keywords' are set so as to fontify them,
or some other font-lock mechanism has the same effect even when this
variable is non-nil.")
(defvar-local font-lock-keywords-case-fold-search nil (defvar-local font-lock-keywords-case-fold-search nil
"Non-nil means the patterns in `font-lock-keywords' are case-insensitive. "Non-nil means the patterns in `font-lock-keywords' are case-insensitive.