Subject: Re: bug#15577: 24.3; dir-local variables not applied when switching major-mode

From: yary <[email-masked]>
Date: Sun, 20 Oct 2013 09:00:57 -0400

For anyone following this discussion, I moved the non-dir-local parts to:

bug#15658: Easy way to make a file-local variable also permanent-local
bug#15659: Simple method for preserving minor-mode

>> Moving dir-local setup code to after-change-major-mode-hook would be a
>> simple fix for issue #1. File-local (as it is now) in
>> after-change-major-mode-hook would cause some problems eg. if a
>> file-local sets the mode!
>
>Obviously if we move the mode-setting part, we introduce a bug, so we
>wouldn't move it (it's already handled separately for the same kind of
>reasons).

Right. So it looks like a patch for moving dir-local setup to
after-change-major-mode-hook is in order. Where I fall down in the
implementation is figuring out what exactly changes so that I don't
change behavior for find-file or kill-all-local-variables, and also
don't set dir-locals twice when opening a file (without using
defadvice which seems wrong in the core). Plus I'd have to get started
as a contributor. Neither are insurmountable, though I think I don't
have much more time to devote to these at the moment.