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

@@ -4,7 +4,6 @@
;;; Packages
(use-package! treesit
:when (fboundp 'treesit-available-p)
:when (treesit-available-p)
:defer t
:preface
@@ -48,8 +47,7 @@
(let ((mode (funcall fn mode)))
(if-let* ((ts (get mode '+tree-sitter))
(fallback-mode (car ts)))
(cond ((or (not (fboundp 'treesit-available-p))
(not (treesit-available-p)))
(cond ((not (treesit-available-p))
(message "Treesit unavailable, falling back to `%S'" fallback-mode)
fallback-mode)
((not (fboundp mode))