From d19c5114250aa474d686bd76e06347372898e28b Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Sun, 26 Apr 2026 22:07:33 -0700 Subject: [PATCH] ; Add heuristic for treesit--update-ranges-non-local * lisp/treesit.el (treesit--update-ranges-non-local): Treat language symbols that happens to be a command as just language symbol, not function. --- lisp/treesit.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 387d2716f5b..2b2740e2fb4 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1079,7 +1079,8 @@ returns the ranges to use for that node. Return updated parsers as a list." (let ((ranges-by-lang - (if (functionp embed-lang) + ;; Filter out functions like `markdown' using `commandp'. + (if (and (functionp embed-lang) (not (commandp embed-lang))) (treesit-query-range-by-language host-parser query embed-lang beg end offset range-fn) (list (cons embed-lang