Documentation for treesit-font-lock-rules change

* doc/lispref/modes.texi (Parser-based Font Lock): Update manual.
* lisp/treesit.el (treesit-font-lock-rules): Update docstring.
This commit is contained in:
Yuan Fu
2023-10-21 11:05:47 -07:00
parent 5e546abf7a
commit aa6cb41661
3 changed files with 11 additions and 1 deletions

View File

@@ -4149,7 +4149,7 @@ it add meta information to it. The @code{:language} keyword declares
name of @var{query}. Users can control which features are enabled
with @code{treesit-font-lock-level} and
@code{treesit-font-lock-feature-list} (described below). These two
keywords are mandatory.
keywords are mandatory (with exceptions).
Other keywords are optional:
@@ -4161,6 +4161,9 @@ Other keywords are optional:
@item @tab @code{append} @tab Append the new face to existing ones
@item @tab @code{prepend} @tab Prepend the new face to existing ones
@item @tab @code{keep} @tab Fill-in regions without an existing face
@item @code{:default-language} @tab @var{language}
@tab Every @var{query} after this keyword will use @var{language}
by default.
@end multitable
Lisp programs mark patterns in @var{query} with capture names (names

View File

@@ -1353,6 +1353,11 @@ Since circular alias chains now cannot occur, 'function-alias-p',
'indirect-function' and 'indirect-variable' will never signal an error.
Their 'noerror' arguments have no effect and are therefore obsolete.
+++
** 'treesit-font-lock-rules' now accepts additional global keywords.
When supplied with ':default-language LANGUAGE', rules after it will
default to use 'LANGUAGE'.
* Changes in Emacs 30.1 on Non-Free Operating Systems

View File

@@ -892,6 +892,8 @@ Other keywords include:
`append' Append the new face to existing ones.
`prepend' Prepend the new face to existing ones.
`keep' Fill-in regions without an existing face.
:default-language LANGUAGE Every QUERY after this keyword
will use LANGUAGE by default.
Capture names in QUERY should be face names like
`font-lock-keyword-face'. The captured node will be fontified