emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a85609c22d2 2/3: ; * lisp/treesit.el (treesit-node-top-level): cl


From: Mattias Engdegård
Subject: master a85609c22d2 2/3: ; * lisp/treesit.el (treesit-node-top-level): cleaner and faster
Date: Tue, 9 May 2023 08:15:37 -0400 (EDT)

branch: master
commit a85609c22d21adee6308ce15c3ed5515baef3ace
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    ; * lisp/treesit.el (treesit-node-top-level): cleaner and faster
---
 lisp/treesit.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 54f223dc40b..e9ca45c0d6c 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -251,8 +251,7 @@ than using NODE's type.  PRED can also be a predicate 
function,
 and more.  See `treesit-thing-settings' for details.
 
 If INCLUDE-NODE is non-nil, return NODE if it satisfies PRED."
-  (let ((pred (or pred (rx-to-string
-                        `(seq bos ,(treesit-node-type node) eos))))
+  (let ((pred (or pred (rx bos (literal (treesit-node-type node)) eos)))
         (result nil))
     (cl-loop for cursor = (if include-node node
                             (treesit-node-parent node))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]