[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 09b5f00613: ; Fix calls to treesit functions
From: |
Eli Zaretskii |
Subject: |
master 09b5f00613: ; Fix calls to treesit functions |
Date: |
Sun, 18 Dec 2022 12:14:14 -0500 (EST) |
branch: master
commit 09b5f00613572dd27f43626aed21f3659d5ced64
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
; 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>.
---
lisp/progmodes/prog-mode.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index b46a9affcd..aa37a4ac86 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)))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 09b5f00613: ; Fix calls to treesit functions,
Eli Zaretskii <=