branch: elpa/clojure-ts-mode
commit 5df8343c1ee65b37e6085a14589318bf6583817f
Author: Roman Rudakov <rruda...@fastmail.com>
Commit: Bozhidar Batsov <bozhi...@batsov.dev>

    Inline treesit-query-p to ensure compatibility with Emacs 30
---
 clojure-ts-mode.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/clojure-ts-mode.el b/clojure-ts-mode.el
index c2dd69b7fb..29944b90a9 100644
--- a/clojure-ts-mode.el
+++ b/clojure-ts-mode.el
@@ -2472,6 +2472,12 @@ before DELIM-OPEN."
            "v0.24.3"))
   "Intended to be used as the value for `treesit-language-source-alist'.")
 
+(defun clojure-ts--query-valid-p (query)
+  "Return non-nil if QUERY is valid in Clojure, nil otherwise."
+  (ignore-errors
+    (treesit-query-compile 'clojure query t)
+    t))
+
 (defun clojure-ts--clojure-grammar-outdated-p ()
   "Return TRUE if currently installed grammar is outdated.
 
@@ -2479,7 +2485,7 @@ This function checks if `clojure-ts-mode' is compatible 
with the
 currently installed grammar.  The simplest way to do this is to validate
 a query that is valid in a previous grammar version but invalid in the
 required version."
-  (treesit-query-valid-p 'clojure '((sym_lit (meta_lit)))))
+  (clojure-ts--query-valid-p '((sym_lit (meta_lit)))))
 
 (defun clojure-ts--ensure-grammars ()
   "Install required language grammars if not already available."

Reply via email to