Subject: inhibit-local-variables-regexps, auto-coding-alist, auto-mode-alist

From: Glenn Morris <[email-masked]>
Date: Thu, 26 Jan 2012 02:00:21 -0500

Package: emacs
Severity: minor

>From bug#10506:

There is some duplication between inhibit-local-variables-regexps and
auto-coding-alist. Many of the elements are common to each.
Also, they both duplicate some elements of auto-mode-alist.
What i-l-v-r really wants is a list of modes, not extensions. Eg "tar
mode". Then the extensions could be looked up in auto-mode-alist.

Stefan's suggestion:

    I think the way to reduce such redundancy (without removing the
    possibility to handle things differently) is to add indirections:
    e.g. allow not just regexps but also major-mode symbols (so
    auto-mode-alist maps the file name to a major mode and than this
    mode can be consulted in inhibit-file-variables-regexps and
    auto-coding-alist, and we (w|c)ould ideally take major-mode
    inheritance into account so we could make tar-mode and image-mode
    inherit from a binary-mode parent and only have binary-mode listed
    in those two lists).