[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#9659: 24.0.50; turn-on function of `define-globalized-minor-mode' do
From: |
Stefan Monnier |
Subject: |
bug#9659: 24.0.50; turn-on function of `define-globalized-minor-mode' doesn't see some hook-set vars |
Date: |
Wed, 12 Oct 2011 08:35:27 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) |
> Thanks, I'll update my extension docs accordingly!
Good, thank you,
Stefan
> On Wed, Oct 12, 2011 at 5:39 AM, Stefan Monnier
> <monnier@iro.umontreal.ca> wrote:
>>> I don't know if this is expected behaviour, but in recent Emacs
>>> versions the following strategy to selectively deactivate a minor mode
>>> in some major mode combinations does not work anymore. This used to
>>> work fine in Emacs 22 and 23.
>>
>> Indeed, it's on purpose, ironically it's so that you can do what you're
>> doing:
>>
>> 2010-04-28 Stefan Monnier <monnier@iro.umontreal.ca>
>>
>> Make it possible to locally disable a globally enabled mode.
>> * simple.el (fundamental-mode): Run fundamental-mode-hook.
>> * emacs-lisp/derived.el (define-derived-mode): Use fundamental-mode
>> rather than kill-all-local-variables so it runs fundamental-mode-hook.
>> * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
>> Use fundamental-mode-hook to run MODE-enable-in-buffers earlier, so
>> that subsequent hooks get a chance to disable it.
>>
>> I.e. with this change, you can skip dummy-mode-dont-turn-on and just do:
>>
>> (add-hook 'text-mode-hook #'(lambda () (dummy-mode -1)))
>> (add-hook 'help-mode-hook #'(lambda () (dummy-mode -1)))
>>
>>
>> -- Stefan
>>
> --
> João Távora