Variable: treesit-thing-settings
treesit-thing-settings is a variable defined in treesit.c.
Value
nil
Documentation
A list defining things.
The value should be an alist of (LANGUAGE . DEFINITIONS), where LANGUAGE is a language symbol, and DEFINITIONS is a list of
(THING PRED)
THING is a symbol representing the thing, like defun, sexp, or
sentence; PRED defines what kind of node can be qualified as THING.
PRED can be a regexp string that matches the type of the node; it can be a predicate function that takes the node as the sole argument and returns t if the node is the thing, and nil otherwise; it can be a cons (REGEXP . FN), which is a combination of a regexp and a predicate function, and the node has to match both to qualify as the thing.
PRED can also be recursively defined. It can be (or PRED...), meaning satisfying anyone of the inner PREDs qualifies the node; or (not PRED), meaning not satisfying the inner PRED qualifies the node.
Finally, PRED can refer to other THINGs defined in this list by using the symbol of that THING. For example, (or sexp sentence).
Probably introduced at or before Emacs version 30.1.
Source Code
// Defined in /usr/src/emacs/src/treesit.c
DEFVAR_LISP ("treesit-thing-settings",
Vtreesit_thing_settings,
doc:
/* A list defining things.
The value should be an alist of (LANGUAGE . DEFINITIONS), where
LANGUAGE is a language symbol, and DEFINITIONS is a list of
(THING PRED)
THING is a symbol representing the thing, like `defun', `sexp', or
`sentence'; PRED defines what kind of node can be qualified as THING.
PRED can be a regexp string that matches the type of the node; it can
be a predicate function that takes the node as the sole argument and
returns t if the node is the thing, and nil otherwise; it can be a
cons (REGEXP . FN), which is a combination of a regexp and a predicate
function, and the node has to match both to qualify as the thing.
PRED can also be recursively defined. It can be (or PRED...), meaning
satisfying anyone of the inner PREDs qualifies the node; or (not
PRED), meaning not satisfying the inner PRED qualifies the node.
Finally, PRED can refer to other THINGs defined in this list by using
the symbol of that THING. For example, (or sexp sentence). */);