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: Alan Mackenzie
Subject: Re: Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode [patch]
Date: Thu, 17 Jan 2013 17:51:59 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hi, João.

On Thu, Jan 17, 2013 at 01:17:03PM +0000, João Távora wrote:
> On Tue, Jan 15, 2013 at 2:08 PM, Alan Mackenzie <address@hidden> wrote:

> > I think that's true.  My problem is that font-lock-mode is being called
> > too soon, before the mode has been fully set up by the major mode hook.

> Sorry to hijack, but I have a similiar problem in autopair and yasnippet. My
> problem is that I sometimes want the minor modes never to be called at all
> depending on the major-mode setup.

OK, so I'm not the only person with this problem.  :-)

> While the major-mode hook has a chance to disable them with (xxx-mode -1),
> there's no way to use the major-mode's hook to prevent a globalized minor mode
> from ever being activated in the buffer.

> This is a inneficient and cumbersome for these cases:

> * autopair-minor-mode crashes the system when activated with sldb-minor-mode, 
> I
>   use autopair-mode-on for this and hardcode the sldb reference there. It also
>   does a lot of useless setup of keybindings etc...

> * yas-minor-mode jit-loads snippets for the major mode when invoked. If its
>   turned off immediately after, it loaded them too soon.

> before emacs 24, I used to use xxx-dont-turn-on variables set in major mode 
> hook
> and read in the xxx-mode-on function, but I agree that isn't particularly 
> pretty
> too.

Maybe making a buffer local copy of global-xxxx-mode would do the trick,
but that's anything but pretty.

I'm still trying to come up with a reason somebody might want to turn on
the minor mode _before_ the major mode's hook has been run.

> Thanks,
> --
> João Távora

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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