From a85609c22d21adee6308ce15c3ed5515baef3ace Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Tue, 9 May 2023 13:28:20 +0200 Subject: [PATCH] ; * 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)) -- 2.39.2