Subject: bug#8158: Definition of auto-mode-alist

From: Stefan Monnier <[email-masked]>
Date: Thu, 03 Mar 2011 23:22:03 -0500

>   ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
>   ;; c++-mode, java-mode and more) are added through autoload
>   ;; directives in that file.  That way is discouraged since it
>   ;; spreads out the definition of the initial value.

> Isn't this a bit unmodular as Emacs continues to grow, and given loaddefs.el?

I agree, but I think Richard disagrees.  Also, order of entries in
auto-mode-alist can be important, so autoloading those entries does not
work for all cases.  But for 90% of the cases, it's perfectly fine and
indeed we do use it already in several cases.

Such ordering conflicts are difficult to detect automatically: detecting
them when we compile Emacs requires checking which regexps overlap
(which is perfectly doable in theory, but we'd need a "regexp-to-DFA
compiler" for that, basically), detecting them at run-time is too late
(often it'd be wrong to ask the user to resolve such conflicts).

        Stefan