emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 33485fe8f74: ; Better warning message when loading tree-sitter


From: Eli Zaretskii
Subject: emacs-29 33485fe8f74: ; Better warning message when loading tree-sitter fails
Date: Mon, 15 May 2023 11:40:41 -0400 (EDT)

branch: emacs-29
commit 33485fe8f74af0df458453c89afe4846ccd8e7e5
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    ; Better warning message when loading tree-sitter fails
    
    * lisp/treesit.el (treesit-ready-p): Improve diagnostics on
    MS-Windows when the tree-sitter library cannot be loaded at run
    time.
---
 lisp/treesit.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 147b052d287..d7502560fea 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2300,7 +2300,10 @@ instead of emitting a warning."
     ;; Check for each condition and set MSG.
     (catch 'term
       (when (not (treesit-available-p))
-        (setq msg "tree-sitter library is not compiled with Emacs")
+        (setq msg (if (fboundp 'treesit-node-p)
+                      ;; Windows loads tree-sitter dynakically.
+                      "tree-sitter library is not available or failed to load"
+                    "Emacs is not compiled with tree-sitter library"))
         (throw 'term nil))
       (when (> (position-bytes (max (point-min) (1- (point-max))))
                treesit-max-buffer-size)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]