aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuan Fu2023-10-21 11:05:47 -0700
committerYuan Fu2023-10-21 11:07:30 -0700
commitaa6cb4166174d2b7d601bb3dc6c2f03b5296a442 (patch)
tree779209468848c5faffb4561a04ffa293bed96426
parent5e546abf7a27688150f0bc5c486e860f4ad85198 (diff)
downloademacs-aa6cb4166174d2b7d601bb3dc6c2f03b5296a442.tar.gz
emacs-aa6cb4166174d2b7d601bb3dc6c2f03b5296a442.zip
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.
-rw-r--r--doc/lispref/modes.texi5
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/treesit.el2
3 files changed, 11 insertions, 1 deletions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 00148420893..f365d88fade 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -4149,7 +4149,7 @@ it add meta information to it. The @code{:language} keyword declares
4149name of @var{query}. Users can control which features are enabled 4149name of @var{query}. Users can control which features are enabled
4150with @code{treesit-font-lock-level} and 4150with @code{treesit-font-lock-level} and
4151@code{treesit-font-lock-feature-list} (described below). These two 4151@code{treesit-font-lock-feature-list} (described below). These two
4152keywords are mandatory. 4152keywords are mandatory (with exceptions).
4153 4153
4154Other keywords are optional: 4154Other keywords are optional:
4155 4155
@@ -4161,6 +4161,9 @@ Other keywords are optional:
4161@item @tab @code{append} @tab Append the new face to existing ones 4161@item @tab @code{append} @tab Append the new face to existing ones
4162@item @tab @code{prepend} @tab Prepend the new face to existing ones 4162@item @tab @code{prepend} @tab Prepend the new face to existing ones
4163@item @tab @code{keep} @tab Fill-in regions without an existing face 4163@item @tab @code{keep} @tab Fill-in regions without an existing face
4164@item @code{:default-language} @tab @var{language}
4165@tab Every @var{query} after this keyword will use @var{language}
4166by default.
4164@end multitable 4167@end multitable
4165 4168
4166Lisp programs mark patterns in @var{query} with capture names (names 4169Lisp programs mark patterns in @var{query} with capture names (names
diff --git a/etc/NEWS b/etc/NEWS
index 3810305e9f4..5d42d88fb60 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1353,6 +1353,11 @@ Since circular alias chains now cannot occur, 'function-alias-p',
1353'indirect-function' and 'indirect-variable' will never signal an error. 1353'indirect-function' and 'indirect-variable' will never signal an error.
1354Their 'noerror' arguments have no effect and are therefore obsolete. 1354Their 'noerror' arguments have no effect and are therefore obsolete.
1355 1355
1356+++
1357** 'treesit-font-lock-rules' now accepts additional global keywords.
1358When supplied with ':default-language LANGUAGE', rules after it will
1359default to use 'LANGUAGE'.
1360
1356 1361
1357* Changes in Emacs 30.1 on Non-Free Operating Systems 1362* Changes in Emacs 30.1 on Non-Free Operating Systems
1358 1363
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 669f41d8015..80bdf164b07 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -892,6 +892,8 @@ Other keywords include:
892 `append' Append the new face to existing ones. 892 `append' Append the new face to existing ones.
893 `prepend' Prepend the new face to existing ones. 893 `prepend' Prepend the new face to existing ones.
894 `keep' Fill-in regions without an existing face. 894 `keep' Fill-in regions without an existing face.
895 :default-language LANGUAGE Every QUERY after this keyword
896 will use LANGUAGE by default.
895 897
896Capture names in QUERY should be face names like 898Capture names in QUERY should be face names like
897`font-lock-keyword-face'. The captured node will be fontified 899`font-lock-keyword-face'. The captured node will be fontified