From 776da0dcf18e63cde43a0ddd0015e1678bfb3433 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 16 May 2025 08:46:21 +0200 Subject: [PATCH] fix(csharp): csharp-ts-mode: side-effects on auto-mode-alist Would otherwise be imposed every time the mode is activated. --- modules/lang/csharp/config.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/lang/csharp/config.el b/modules/lang/csharp/config.el index d92844558..08f99fab2 100644 --- a/modules/lang/csharp/config.el +++ b/modules/lang/csharp/config.el @@ -50,6 +50,14 @@ on for `csharp-mode' font lock breaks after an interpolated string or terminating simple string." :around #'csharp-disable-clear-string-fences (unless (eq major-mode 'csharp-mode) + (apply fn args))) + + ;; HACK: `csharp-ts-mode' changes `auto-mode-alist' every time the mode is + ;; activated, which runs the risk of overwriting user (or Doom) entries. + ;; REVIEW: Should be addressed upstream. + (defadvice! +csharp--undo-ts-side-effects-a (fn &rest args) + :around #'csharp-ts-mode + (let (auto-mode-alist) (apply fn args))))