;; `functionp'.
((alist-get exp treesit-simple-indent-presets))
((functionp exp) exp)
- ((symbolp exp)
- (if (null exp)
- exp
- ;; Matchers only return lambdas, anchors only return
- ;; integer, so we should never see a variable.
- (signal 'treesit-indent-error
- (list "Couldn't find the preset corresponding to expression"
- exp))))
+ ;; There are higher-order presets that take arguments, like
+ ;; (nth-sibling 1 t), so it's possible for exp to be something
+ ;; other than numbers and functions. Don't signal an error if
+ ;; exp isn't a function nor a number. In fact, allow exp to be
+ ;; any symbol or keyword, so users can define higher-order
+ ;; presets that takes keyword or symbol as arguments.
(t exp)))
;; This variable might seem unnecessary: why split