Subject: Re: bug#58075: Mapping file types to major modes

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 26 Sep 2022 13:26:48 +0200

Stefan Monnier <[email-masked]> writes:

> We have various ways to deal with those different cases, which are
> variously convenient/successful, but for things like `cperl-mode` vs
> `perl-mode` or `latex-mode` vs AUCTeX the usual solution is not
> satisfactory since it looks like:
>
>     (defalias 'perl-mode #'cperl-mode)

Isn't the usual solution to just make `auto-mode-alist' map .pl to
cperl-mode instead of perl-mode?

Hm, well, that's

     ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode)

so it's a bit of a mouthful.

> We could have
>
>     (add-to-list 'major-mode-remap-alist '(perl-mode . cperl-mode))

This area is already pretty complicated, so I worry that this is going
to make things even more confusing.  But perhaps it's worth it?