[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15577: 24.3; dir-local variables not applied when switching major-mo
From: |
Stefan Monnier |
Subject: |
bug#15577: 24.3; dir-local variables not applied when switching major-mode |
Date: |
Fri, 18 Oct 2013 21:18:39 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> 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.
> a. Get all of that mode's customizable buffer-locals.
Not sure what that is.
> Ideally the minor-mode, or emacs core, would provide a function for
> that purpose.
It's probably not possible (not reliably at least) with the way minor
modes are defined currently. Tho depending on what you mean it might be
a non-issue.
> b. Mark those variables as permanent-local
There's no such thing, currently (we instead have to use a hack with
change-major-mode-hook, along the lines of what you did).
For minor-modes, what we could do is to check which buffer-local
minor-modes are enabled, and to "simply" re-enable them in
after-change-major-mode-hook.
But there are some issues:
- we have to find out which buffer-local minor-modes are enabled, which
presumes we have some kind of list of minor-modes. We can probably
use minor-mode-list for that, tho.
- some minor modes are mode-specific; e.g. it doesn't make much sense to
preserve reftex-mode when switching from latex-mode to haskell-mode.
Stefan
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, yary, 2013/10/09
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, Glenn Morris, 2013/10/09
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, yary, 2013/10/10
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, Glenn Morris, 2013/10/10
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, Stefan Monnier, 2013/10/10
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, yary, 2013/10/10
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, yary, 2013/10/14
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, yary, 2013/10/16
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, yary, 2013/10/18
- bug#15577: 24.3; dir-local variables not applied when switching major-mode,
Stefan Monnier <=
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, yary, 2013/10/19
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, Stefan Monnier, 2013/10/19
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, yary, 2013/10/20
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, Phil Sainty, 2013/10/20
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, Stefan Monnier, 2013/10/21
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, yary, 2013/10/21
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, Stefan Monnier, 2013/10/21
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, Phil Sainty, 2013/10/21
- bug#15577: 24.3; dir-local variables not applied when switching major-mode, Phil Sainty, 2013/10/18