From 8dab364e4635d1ff1396d5fc416d8d891642f869 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 3 Sep 2025 14:42:28 +0200 Subject: [PATCH] fix(tree-sitter): suppress changes to {auto,interpreter}-mode-alist ...when auto-loading a ts-mode package. --- modules/tools/tree-sitter/config.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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