From b1bcd396ede2323e5501d6ec78a5246a6e1dae72 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Thu, 7 Sep 2023 17:56:11 -0700 Subject: [PATCH] Fix treesit-thing-definition * lisp/treesit.el (treesit-thing-definition): Don't modify treesit-thing-settings itself. --- lisp/treesit.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 57521a236e0..c5ca492a837 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2064,7 +2064,9 @@ If LANGUAGE is nil, return the first definition for THING in (if language (car (alist-get thing (alist-get language treesit-thing-settings))) - (car (alist-get thing (mapcan #'cdr treesit-thing-settings))))) + (car (alist-get thing (mapcan (lambda (entry) + (copy-tree (cdr entry))) + treesit-thing-settings))))) (defalias 'treesit-thing-defined-p 'treesit-thing-definition "Return non-nil if THING is defined.") -- 2.39.5