GNU bug report logs - #15577
24.3; dir-local variables not applied when switching major-mode

Previous Next

Package: emacs;

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

From: yary <not.com <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, 15577 <15577 <at> debbugs.gnu.org>
Subject: bug#15577: 24.3; dir-local variables not applied when switching major-mode
Date: Mon, 14 Oct 2013 14:41:34 -0400
Thinking about switching major modes more, my instinct is that the
right solution involves being "smarter" both about which local
variables to clear and reloading any {dir,file}-local variables for
the new node.

Basically, at the start, instead of calling
"kill-all-local-variables", only clear the locals that were set as a
consequence of the old mode. That is, if it was set directly by the
old mode, or by dir-local matching the old mode, delete it. Don't
delete a buffer-local variable if it was set explicitly by the user
after opening during the editing session.

Then after the new mode has set itself, recheck dir-locals and set any
that match the new mode.

Alas I don't use file-locals so am not sure how their use cases fit.
Ignore any "mode:" specifiers and maybe "eval:" as well after the
mode-change, I'd guess.




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.