* 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>.
(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")
(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)))))))