diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-12-18 19:13:10 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-12-18 19:13:10 +0200 |
commit | 09b5f00613572dd27f43626aed21f3659d5ced64 (patch) | |
tree | 0dac5246977ec15767687f58e3c24cc2a6e2ba39 /lisp/progmodes/prog-mode.el | |
parent | 614695a5ad521be9a159d1116a208db48604467d (diff) | |
download | emacs-09b5f00613572dd27f43626aed21f3659d5ced64.tar.gz |
; Fix calls to treesit functions
* lisp/progmodes/prog-mode.el (treesit-available-p): Declare.
(prog-fill-reindent-defun): Only call treesit.c functions if
treesit-available-p returns non-nil. Reported by Eduardo Ochs
<eduardoochs@gmail.com>.
Diffstat (limited to 'lisp/progmodes/prog-mode.el')
-rw-r--r-- | lisp/progmodes/prog-mode.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index b46a9affcd3..aa37a4ac865 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -33,6 +33,7 @@ (require 'subr-x) (require 'treesit)) +(declare-function treesit-available-p "treesit.c") (declare-function treesit-parser-list "treesit.c") (declare-function treesit-node-type "treesit.c") @@ -156,7 +157,8 @@ or follows point." (interactive "P") (save-excursion (let ((treesit-text-node - (and (treesit-parser-list) + (and (treesit-available-p) + (treesit-parser-list) (string-match-p treesit-text-type-regexp (treesit-node-type (treesit-node-at (point))))))) |