; 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. Again, @var{thing} can be either a symbol or a predicate.
If @var{parser} is non-nil, only use that parser's parse tree. If @var{parser} is non-@code{nil}, only use that parser's parse tree.
Otherwise each parser covering point is tried from most specific Otherwise try each parser covering point, from the most specific
(deepest embedded) to least specific. If there are multiple parsers with (deepest-embedded) to the least specific. If there are multiple parsers with
the same embed level at @var{pos}, which parser is tried first is the same embed level at @var{position}, which parser is tried first is
undefined. If PARSER is a language symbol, the parsers tried are undefined. If @var{parser} is a language symbol, the function limits
limited to ones for that language. the parsers it tries to the ones for that language.
@end defun @end defun
@defun treesit-thing-next position thing &optional parser @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 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 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 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 @end defun
@defun treesit-navigate-thing position arg side thing &optional tactic @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. @code{treesit-thing-settings}, or a predicate.
If @var{parser} is non-nil, only use that parser's parse tree. If @var{parser} is non-nil, only use that parser's parse tree.
Otherwise each parser covering point is tried from most specific (deepest Otherwise try each parser covering point, from the most specific
embedded) to least specific. If there are multiple parsers with the same (deepest-embedded) to the least specific. If there are multiple parsers
embed level at @var{pos}, which parser is tried first is undefined. with the same embed level at @var{position}, which parser is tried first is
@var{parser} can also be a language symbol. undefined. @var{parser} can also be a language symbol.
@end defun @end defun
@findex treesit-beginning-of-thing @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'. 'treesit-language-at' that uses the new function 'treesit-parsers-at'.
+++ +++
*** Tree-sitter thing functions now work better with multiple parsers *** Tree-sitter thing functions now work better with multiple parsers.
These functions now have better handling when there are multiple The following functions now handle better the case when there are
parsers at point: 'treesit-thing-prev', 'treesit-thing-next', multiple parsers at point: 'treesit-thing-prev', 'treesit-thing-next',
'treesit-navigate-thing', 'treesit-thing-at'. When there are multiple 'treesit-navigate-thing', 'treesit-thing-at'. When there are multiple
parsers at point, instead of using whatever 'treesit-node-at' returns at parsers at point, instead of using whatever 'treesit-node-at' returns at
point, these functions now try every relevant parser in descending point, these functions now try every relevant parser in descending order
order of relevance. (Deeper embedded parser has higher relevance.) of relevance. (Deeper-embedded parsers have higher relevance.) These
These functions now also take an additional optional argument, PARSER, functions now also take an additional optional argument, PARSER, that
that allows caller to specify a parser or language to use. That also allows caller to specify a parser or language to use. That also means
means 'treesit-beginning/end-of-defun' now can move across parsers. 'treesit-beginning/end-of-defun' now can move across parsers.
+++ +++