diff --git a/modules/tools/tree-sitter/config.el b/modules/tools/tree-sitter/config.el index cf1ca0ed5..2e7b2e166 100644 --- a/modules/tools/tree-sitter/config.el +++ b/modules/tools/tree-sitter/config.el @@ -62,7 +62,10 @@ (warning-suppress-types (cons '(treesit) warning-suppress-types))) (or (not (autoloadp fn)) - (autoload-do-load fn mode))) + ;; ts-modes usually change these alists at autoload + ;; *and* load time. + (let (auto-mode-alist interpreter-mode-alist) + (autoload-do-load fn mode)))) ;; Only prompt once, and log other times. (or (null (cdr ts)) ; no grammars, no problem! ;; If the base/fallback mode doesn't exist, let's