From: Yuan Fu Date: Fri, 8 Sep 2023 00:56:11 +0000 (-0700) Subject: Fix treesit-thing-definition X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b1bcd396ede2323e5501d6ec78a5246a6e1dae72;p=emacs.git Fix treesit-thing-definition * lisp/treesit.el (treesit-thing-definition): Don't modify treesit-thing-settings itself. --- 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.")