From 35668ce10da1548c5a371a0f24d48b35a1c8854f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Kryger?= Date: Fri, 15 Nov 2024 10:45:57 +0000 Subject: [PATCH] [try] treesit check for bound variables to prevent auto downloading --- modules/init-treesit.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/init-treesit.el b/modules/init-treesit.el index b3b5587e..65cd937e 100644 --- a/modules/init-treesit.el +++ b/modules/init-treesit.el @@ -23,10 +23,13 @@ (message "Enabling built-in treesit and external treesit-auto") (use-package treesit-auto :after treesit + :demand t :commands (global-treesit-auto-mode) :custom - (treesit-auto-install (unless (getenv "ci_tests") - 'prompt) + (treesit-auto-install (if (boundp 'treesit-auto-install) + treesit-auto-install + (unless (getenv "ci_tests") + 'prompt)) "Disable automatic grammar downloading in CI") :config (global-treesit-auto-mode)) @@ -64,7 +67,9 @@ (use-package tree-sitter-langs :defines (tree-sitter-langs--testing) :init - (setq tree-sitter-langs--testing (getenv "ci_tests"))) + (setq tree-sitter-langs--testing (or (and (boundp 'tree-sitter-langs--testing) + tree-sitter-langs--testing) + (getenv "ci_tests")))) (use-package tree-sitter :diminish :after (tree-sitter-langs)