From: Mattias EngdegÄrd Date: Tue, 9 May 2023 11:28:20 +0000 (+0200) Subject: ; * lisp/treesit.el (treesit-node-top-level): cleaner and faster X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a85609c22d21adee6308ce15c3ed5515baef3ace;p=emacs.git ; * lisp/treesit.el (treesit-node-top-level): cleaner and faster --- 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))