GNU bug report logs -
#15577
24.3; dir-local variables not applied when switching major-mode
Previous Next
Reported by: yary <not.com <at> gmail.com>
Date: Wed, 9 Oct 2013 20:15:01 UTC
Severity: normal
Merged with 23407
Found in version 24.3
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Fri, Oct 18, 2013 at 9:18 PM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
>> For sub-issue #1 "dir-locals not being applied in the new mode,"
>> divide the responsibility for setting file-locals and dir-locals
>> between `normal-mode find-file=t' and `define-derived-mode'. Just have
>> `define-derived-mode' call
>> `(hack-dir-local-variables)(hack-local-variables-apply)' unless it is
>> being called as a result of `normal-mode t'. There's no change needed
>> for the normal-mode function or anything it calls, except perhaps
>> setting something that the define-derived-mode macro can check.
>
> Yes, as mentioned earlier, a possible fix is to move the file-local and
> dir-local setup code from normal-mode to after-change-major-mode-hook.
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!
I'm opening a new bug for handling file-locals after
major-mode-change, it's different enough to warrant its own discussion
(and will also answer your questions about what I meant there), The
initial report here was about dir-locals, which has a solution
independent from the other buffer-local issues; let's just keep this
bug#15577 about re-applying dir locals after a mode change.
This bug report was last modified 9 years and 13 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.