Fix treesit-thing-definition

* lisp/treesit.el (treesit-thing-definition): Don't modify
treesit-thing-settings itself.
This commit is contained in:
Yuan Fu 2023-09-07 17:56:11 -07:00
parent 9f6cf89fb1
commit b1bcd396ed
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -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.")