fix(tree-sitter): backport treesit-*-abi-version

So we don't have to litter these checks with feature/fboundp
checks (there will potentially be many of them).
This commit is contained in:
Henrik Lissner
2025-09-02 03:18:42 +02:00
parent 13e32dcbe9
commit 79a9418cba

View File

@@ -7,12 +7,24 @@
(autoload 'treesit-ready-p "treesit")
;; In case of Emacs builds where treesit isn't built in (to avoid void-function
;; errors and verbose, redundant checks everywhere).
;;;###autoload
(unless (fboundp 'treesit-available-p)
(defun treesit-available-p ()
"Return non-nil if tree-sitter support is built-in and available."
nil))
;;;###autoload
(unless (fboundp 'treesit-library-abi-version)
(defun treesit-library-abi-version (&optional _min-compatible)
0))
;;;###autoload
(unless (fboundp 'treesit-language-abi-version)
(defun treesit-language-abi-version (&optional _lang)
nil))
;;;###autoload
(defcustom treesit-auto-install-grammar 'ask
"Whether to install tree-sitter language grammar libraries when needed.