[ I added Stefan Monnier in Cc: list. ] Hi Tim, thanks for notifying us. I confirmed that your recipe reproduces the issue.
I think AUCTeX should remove the entry (LaTeX-mode . latex-mode) and alikes from major-mode-remap-alist, as I and Stefan discussed in personal correspondenses last March. Stefan, do you have any comments? Supplementary note: AUCTeX once tried very hard not to touch such Emacs default settings so that users who prefer particular built-in mode can easily get rid of AUCTeX mode with simple customization. But I expect it is safe to remove (LaTeX-mode . latex-mode) in major-mode-remap-alist because AUCTeX now offers only ELPA releases. When the user want to disable the site-wide activation of AUCTeX, they can suppress AUCTeX completely by (push '(auctex nil) package-load-list) in early-init.el, which prevents the removal in major-mode-remap-alist by AUCTeX init code. Best regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW >>>>> Tim Ruffing <d...@real-or-random.org> writes: > On Tue, 2025-01-14 at 08:25 +0100, Arash Esbati wrote: >> Tim Ruffing <d...@real-or-random.org> writes: >> >> > AUCTeX does the opposite. This means that after loading AUXTeX, >> > we'll >> > get this "funny" value for major-mode-remap-defaults: >> > >> > ((doctex-mode . docTeX-mode) >> > (latex-mode . LaTeX-mode) >> > (texinfo-mode . Texinfo-mode) >> > (plain-tex-mode . plain-TeX-mode) >> > (tex-mode . TeX-tex-mode) >> > (LaTeX-mode . latex-mode) >> > (plain-TeX-mode . plain-tex-mode) >> > (TeX-mode . tex-mode)) >> > >> > Now this is full chaos. If you set latex-mode in auto-mode-alist, >> > you'll get LaTeX-mode, and the other way around. (I mean, at least >> > Emacs stops after one remapping and doesn't enter infinite loop.) >> >> I'm not sure if I follow. Can you provide a recipe what and how you >> add >> an entry to `auto-mode-alist' that break things? The value above >> might >> look funny, but AFAICT, it works. I currently fail to see the chaos. >> > Just with the defaults, without changing `auto-mode-alist' manually: > 1. touch /tmp/test.drv > 2. Start Emacs 30.93.2 with AUCTeX installed > 3. Visit /tmp/test.drv > 4. M-x describe-mode. The mode is latex-mode instead of LaTeX-mode > This is because AUCTeX this to `auto-mode-alist': > ("\\.drv\\'" . LaTeX-mode) > And then this remapping (new in Emacs 30) kicks in: > (LaTeX-mode . latex-mode) > I expect that the same will happen with any entry manually added to > `auto-mode-alist' if it specifies an AUCTeX mode.