From 8b6a0de964d61cb8d57ed3fe65086fa305a3c53e Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Tue, 21 Mar 2023 14:50:07 -0700 Subject: 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. --- lisp/treesit.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lisp/treesit.el') 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 -- cgit v1.2.1