From b9b03d4e3fbddda2d8d0c9222409e41d10b0f233 Mon Sep 17 00:00:00 2001 From: Roman Rudakov Date: Thu, 29 May 2025 11:38:47 +0200 Subject: [PATCH] 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 c2dd69b..29944b9 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."