summaryrefslogtreecommitdiff
path: root/doc/lispref/modes.texi
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2022-11-08 10:39:53 -0800
committerYuan Fu <casouri@gmail.com>2022-11-08 10:39:53 -0800
commit29418f954eb114bf3c108b6e03569036f854ae45 (patch)
treed10b4a231b94d4d92bed5f0a3298f6cf6b049fdf /doc/lispref/modes.texi
parent07292b1344549a164eff9d548f819235a14a0b4e (diff)
downloademacs-29418f954eb114bf3c108b6e03569036f854ae45.tar.gz
; Improve tree-sitter documentation
* doc/lispref/modes.texi (Parser-based Font Lock) * doc/lispref/parsing.texi (Multiple Languages) * lisp/treesit.el (treesit-range-rules) (treesit-font-lock-rules): Improve phrasing around queries and keyword and values.
Diffstat (limited to 'doc/lispref/modes.texi')
-rw-r--r--doc/lispref/modes.texi22
1 files changed, 11 insertions, 11 deletions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 8a0b5a12a10..da190b0b02e 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -3950,16 +3950,16 @@ example:
@end group
@end example
-This function takes a series of @var{query-spec}s, which are triplets
-@w{@code{@var{:keyword} @var{value} @dots{} @var{query}}}. Each
-@var{query} is a tree-sitter query in either the string, s-expression
-or compiled form.
-
-The @var{:keyword} and @var{value} pairs configure the query which
-follows them in the argument list. The @code{:lang} keyword sets the
-query's language. The @code{:feature} keyword sets the feature name
-of the query. Users can control which features are enabled with
-@code{font-lock-maximum-decoration} and
+This function takes a series of @var{query-spec}s, where each
+@var{query-spec} is a @var{query} preceded by multiple pairs of
+@var{:keyword} and @var{value}. Each @var{query} is a tree-sitter
+query in either the string, s-expression or compiled form.
+
+For each @var{query}, the @var{:keyword} and @var{value} pairs add
+meta information to it. The @code{:lang} keyword declares
+@var{query}'s language. The @code{:feature} keyword sets the feature
+name of @var{query}. Users can control which features are enabled
+with @code{font-lock-maximum-decoration} and
@code{treesit-font-lock-feature-list} (described below). These two
keywords are mandated.
@@ -3975,7 +3975,7 @@ Other keywords are optional:
@item @tab @code{keep} @tab Fill-in regions without an existing face
@end multitable
-Lisp programs mark patterns in the query with capture names (names
+Lisp programs mark patterns in @var{query} with capture names (names
that starts with @code{@@}), and tree-sitter will return matched nodes
tagged with those same capture names. For the purpose of
fontification, capture names in @var{query} should be face names like