[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Redundant (harmful) duplication of run-hooks in define-globalized-mi
From: |
Alan Mackenzie |
Subject: |
Re: Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode [patch-2] |
Date: |
Fri, 1 Feb 2013 15:44:53 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi, Stefan.
On Thu, Jan 31, 2013 at 09:38:31AM -0500, Stefan Monnier wrote:
> > + (MODE-cancel-disable
> > + (intern (concat global-mode-name "-cancel-disable")))
> > + (MODE-disable-in-buffer
> > + (intern (concat global-mode-name "-disable-in-buffer")))
> If you defvar-local the MODE-disable-in-buffer, .....
That would be disable-MODE I think you meant. Yes, I've now made
disable-MODE buffer local. It has to be buffer local, considering the
way that MODE-enable-in-buffers checks all buffers each time it runs.
> .... then you shouldn't need MODE-cancel-disable since
> kill-all-local-variables will have reset MODE-disable-in-buffer to nil
> already.
I'm not so sure about this. These complicated structures of macros and
hooks and generated functions are making my head hurt. ;-( Are you
sure there are no ways of invoking this which won't bypass
kill-all-local-variables? (That's a real question, not a rhetorical
one.)
Another thought. As I've coded it up, the disable-MODE flag, once it
becomes t, stays t (upto the next major mode change). However, running
global-MODE still enables MODE on this buffer. Should we worry about
this? I don't think we need to.
[Amended patch not included.]
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).
- Re: Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode [patch-2],
Alan Mackenzie <=