diff options
author | Yuan Fu <casouri@gmail.com> | 2023-03-21 14:50:07 -0700 |
---|---|---|
committer | Yuan Fu <casouri@gmail.com> | 2023-03-21 14:51:41 -0700 |
commit | 8b6a0de964d61cb8d57ed3fe65086fa305a3c53e (patch) | |
tree | f7b97fef13694e337da269c98a764cb96fb71624 /lisp/treesit.el | |
parent | 35648a8673010a49720476821732df96ad8fa532 (diff) | |
download | emacs-8b6a0de964d61cb8d57ed3fe65086fa305a3c53e.tar.gz |
Improve docstring of treesit-parent-while (bug#62301)
* doc/lispref/parsing.texi (Retrieving Nodes): Improve and fix
docstring for treesit-parent-until and treesit-parent-while.
* lisp/treesit.el (treesit-parent-while): Improve docstring.
Diffstat (limited to 'lisp/treesit.el')
-rw-r--r-- | lisp/treesit.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/treesit.el b/lisp/treesit.el index b271a1f0c4b..e718ea1a23a 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -324,13 +324,13 @@ If INCLUDE-NODE is non-nil, return NODE if it satisfies PRED." node)) (defun treesit-parent-while (node pred) - "Return the furthest parent of NODE that satisfies PRED. + "Return the furthest parent of NODE (including NODE) that satisfies PRED. -This function successively examines the parent of NODE, then -the parent of the parent, etc., until it finds an ancestor node -which no longer satisfies the predicate PRED; it returns the last -examined ancestor that satisfies PRED. It returns nil if no -ancestor node was found that satisfies PRED. +This function successively examines NODE, the parent of NODE, +then the parent of the parent, etc., until it finds a node which +no longer satisfies the predicate PRED; it returns the last +examined node that satisfies PRED. If no node satisfies PRED, it +returns nil. PRED should be a function that takes one argument, the node to examine, and returns a boolean value indicating whether that |