emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redundant (harmful) duplication of run-hooks in define-globalized-mi


From: Stefan Monnier
Subject: Re: Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode [patch]
Date: Mon, 14 Jan 2013 21:12:15 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> !            (add-hook 'after-change-major-mode-hook
> !                      ',MODE-enable-in-buffers)
> !            (add-hook 'change-major-mode-after-body-hook
>                        ',MODE-enable-in-buffers)
>              (add-hook 'find-file-hook ',MODE-check-buffers)
>              (add-hook 'change-major-mode-hook ',MODE-cmhh))
> --- 399,407 ----
>        ;; Setup hook to handle future mode changes and new buffers.
>        (if ,global-mode
>            (progn
> !            (add-hook ',(if call-before-hook
> !                            'change-major-mode-after-body-hook
> !                          'after-change-major-mode-hook)

I think we first need to understand why we currently use both.
Also, the MODE-enable-in-buffers function should enable the mode only
once, normally, even if called via both hooks.

So if you see a problem, maybe it's because (eq ,MODE-major-mode
major-mode) is not true the second time around, i.e. because
`major-mode' has changed between the two hooks.  Is that the case?
If so, why?


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]