fix: backport treesit-available-p sooner

This fixes Doom for Emacs 27-28 users (or builds without treesit).
This commit is contained in:
Henrik Lissner
2025-09-15 17:25:24 -04:00
parent 64802ae654
commit 71ec9a9733
4 changed files with 22 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
;;; tools/tree-sitter/autoload/compat-30.el -*- lexical-binding: t; -*-
;;;###if (and (fboundp 'treesit-available-p) (version< emacs-version "31.1"))
;;;###if (and (treesit-available-p) (version< emacs-version "31.1"))
;;
;; Backported from 31.1
;;
@@ -7,24 +7,6 @@
(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).
;;;###autodef
(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.