Skip to content

Commit b9b03d4

Browse files
committed
Inline treesit-query-p to ensure compatibility with Emacs 30
1 parent 2dd7ed2 commit b9b03d4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clojure-ts-mode.el

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2472,14 +2472,20 @@ before DELIM-OPEN."
24722472
"v0.24.3"))
24732473
"Intended to be used as the value for `treesit-language-source-alist'.")
24742474

2475+
(defun clojure-ts--query-valid-p (query)
2476+
"Return non-nil if QUERY is valid in Clojure, nil otherwise."
2477+
(ignore-errors
2478+
(treesit-query-compile 'clojure query t)
2479+
t))
2480+
24752481
(defun clojure-ts--clojure-grammar-outdated-p ()
24762482
"Return TRUE if currently installed grammar is outdated.
24772483
24782484
This function checks if `clojure-ts-mode' is compatible with the
24792485
currently installed grammar. The simplest way to do this is to validate
24802486
a query that is valid in a previous grammar version but invalid in the
24812487
required version."
2482-
(treesit-query-valid-p 'clojure '((sym_lit (meta_lit)))))
2488+
(clojure-ts--query-valid-p '((sym_lit (meta_lit)))))
24832489

24842490
(defun clojure-ts--ensure-grammars ()
24852491
"Install required language grammars if not already available."

0 commit comments

Comments
 (0)