Subject: bug#1986: dir-locals.el take precedence over user's mode-hook changes

From: Stefan Monnier <[email-masked]>
Date: Wed, 24 Dec 2008 13:31:06 -0500

[ resent from
  http://lists.gnu.org/archive/html/emacs-devel/2008-12/msg00919.html ]

It seems that the dir-local.el settings are applied after the major mode
hook has been run.
That makes it pretty impossible for the user to override them, which is
problematic (I noticed it because I use a tab-width of 4 in my (Emacs)
ChangeLog files and now tab-width is back to 8).

I guess it's the same problem as the one of setting file-local
variables, but for directories it's even worse.  We should provide some
way to override those settings.

Currently, I add a hook to hack-local-variables-hook from within my
mode-hook, which works but isn't the most obvious.  So we should at
least document this workaround.  Maybe we should also provide
an option inhibit-file-local-variables which contains a list of
variables that hack-local-variables would have to ignore.

        Stefan