; Fix documentation of recent changes in treesit.el

* etc/NEWS:
* doc/lispref/parsing.texi (User-defined Things): Fix punctuation,
markup and typos.
This commit is contained in:
Eli Zaretskii
2026-03-03 15:21:12 +02:00
parent 75f6b5fe09
commit 73a2a5cd05
2 changed files with 19 additions and 19 deletions

View File

@@ -1806,12 +1806,12 @@ returns a node that encloses @var{position}.
Again, @var{thing} can be either a symbol or a predicate.
If @var{parser} is non-nil, only use that parser's parse tree.
Otherwise each parser covering point is tried from most specific
(deepest embedded) to least specific. If there are multiple parsers with
the same embed level at @var{pos}, which parser is tried first is
undefined. If PARSER is a language symbol, the parsers tried are
limited to ones for that language.
If @var{parser} is non-@code{nil}, only use that parser's parse tree.
Otherwise try each parser covering point, from the most specific
(deepest-embedded) to the least specific. If there are multiple parsers with
the same embed level at @var{position}, which parser is tried first is
undefined. If @var{parser} is a language symbol, the function limits
the parsers it tries to the ones for that language.
@end defun
@defun treesit-thing-next position thing &optional parser
@@ -1819,7 +1819,7 @@ This function is similar to @code{treesit-thing-prev}, only it returns
the first node @emph{after} @var{position} that's the @var{thing}. It
also guarantees that if a node is returned, the node's start position is
greater or equal to @var{position}. The @var{parser} parameter is the
same as in @code{treesit-thing-prev} as well.
same as in @code{treesit-thing-prev}.
@end defun
@defun treesit-navigate-thing position arg side thing &optional tactic
@@ -1873,10 +1873,10 @@ position must be strictly greater than @var{position}.
@code{treesit-thing-settings}, or a predicate.
If @var{parser} is non-nil, only use that parser's parse tree.
Otherwise each parser covering point is tried from most specific (deepest
embedded) to least specific. If there are multiple parsers with the same
embed level at @var{pos}, which parser is tried first is undefined.
@var{parser} can also be a language symbol.
Otherwise try each parser covering point, from the most specific
(deepest-embedded) to the least specific. If there are multiple parsers
with the same embed level at @var{position}, which parser is tried first is
undefined. @var{parser} can also be a language symbol.
@end defun
@findex treesit-beginning-of-thing

View File

@@ -1250,16 +1250,16 @@ Multi-language major modes can rely on the default return value from
'treesit-language-at' that uses the new function 'treesit-parsers-at'.
+++
*** Tree-sitter thing functions now work better with multiple parsers
These functions now have better handling when there are multiple
parsers at point: 'treesit-thing-prev', 'treesit-thing-next',
*** Tree-sitter thing functions now work better with multiple parsers.
The following functions now handle better the case when there are
multiple parsers at point: 'treesit-thing-prev', 'treesit-thing-next',
'treesit-navigate-thing', 'treesit-thing-at'. When there are multiple
parsers at point, instead of using whatever 'treesit-node-at' returns at
point, these functions now try every relevant parser in descending
order of relevance. (Deeper embedded parser has higher relevance.)
These functions now also take an additional optional argument, PARSER,
that allows caller to specify a parser or language to use. That also
means 'treesit-beginning/end-of-defun' now can move across parsers.
point, these functions now try every relevant parser in descending order
of relevance. (Deeper-embedded parsers have higher relevance.) These
functions now also take an additional optional argument, PARSER, that
allows caller to specify a parser or language to use. That also means
'treesit-beginning/end-of-defun' now can move across parsers.
+++