From: Yuan Fu Date: Tue, 21 Jan 2025 04:36:41 +0000 (-0800) Subject: Don't signal an error in treesit-node-at X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~83 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a9cde2463abd6677e9d44d306473beef00983aad;p=emacs.git Don't signal an error in treesit-node-at * lisp/treesit.el (treesit-node-at): Wrap treesit-buffer-root-node within condition-case. --- diff --git a/lisp/treesit.el b/lisp/treesit.el index 2887521110b..2aa49a596d8 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -213,9 +213,11 @@ language and doesn't match the language of the local parser." (car (treesit-local-parsers-at pos parser-or-lang)))) (treesit-parser-root-node parser)) - (treesit-buffer-root-node - (or parser-or-lang - (treesit-language-at pos)))))) + (condition-case nil + (treesit-buffer-root-node + (or parser-or-lang + (treesit-language-at pos))) + (treesit-no-parser nil))))) (node root) (node-before root) (pos-1 (max (1- pos) (point-min)))