mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 11:23:24 +00:00
Make treesit--simple-indent-eval more permissive (bug#78065)
* lisp/treesit.el (treesit--simple-indent-eval): Allow EXP to be anything, so higher-order indent presets can take anything as an argument: t, nil, symbols, keywords, etc.
This commit is contained in:
parent
ed7b55f6bf
commit
0b4eb525b6
1 changed files with 6 additions and 8 deletions
|
@ -1902,14 +1902,12 @@ the function."
|
||||||
;; `functionp'.
|
;; `functionp'.
|
||||||
((alist-get exp treesit-simple-indent-presets))
|
((alist-get exp treesit-simple-indent-presets))
|
||||||
((functionp exp) exp)
|
((functionp exp) exp)
|
||||||
((symbolp exp)
|
;; There are higher-order presets that take arguments, like
|
||||||
(if (null exp)
|
;; (nth-sibling 1 t), so it's possible for exp to be something
|
||||||
exp
|
;; other than numbers and functions. Don't signal an error if
|
||||||
;; Matchers only return lambdas, anchors only return
|
;; exp isn't a function nor a number. In fact, allow exp to be
|
||||||
;; integer, so we should never see a variable.
|
;; any symbol or keyword, so users can define higher-order
|
||||||
(signal 'treesit-indent-error
|
;; presets that takes keyword or symbol as arguments.
|
||||||
(list "Couldn't find the preset corresponding to expression"
|
|
||||||
exp))))
|
|
||||||
(t exp)))
|
(t exp)))
|
||||||
|
|
||||||
;; This variable might seem unnecessary: why split
|
;; This variable might seem unnecessary: why split
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue