From: Yuan Fu Date: Tue, 6 Feb 2024 07:12:36 +0000 (-0800) Subject: Use treesit-node-match-p in treesit-parent-while X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c709e03fa510c5b76465f93eaac70f11d83adc73;p=emacs.git Use treesit-node-match-p in treesit-parent-while The previous commit should've done this, but I missed it. * lisp/treesit.el (treesit-parent-while): Use treesit-node-match-p. (cherry picked from commit cebd26b2e16d75a939e2a9f91becc6ec702122a7) --- diff --git a/lisp/treesit.el b/lisp/treesit.el index f179204d89c..6a485ae591a 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -366,7 +366,7 @@ returns nil. PRED can be a predicate function, a regexp matching node type, and more; see docstring of `treesit-thing-settings'." (let ((last nil)) - (while (and node (funcall pred node)) + (while (and node (treesit-node-match-p node pred)) (setq last node node (treesit-node-parent node))) last))