From: Alan Mackenzie <acm@muc.de>
To: "João Távora" <joaotavora@gmail.com>
Cc: Chong Yidong <cyd@gnu.org>,
Stefan Monnier <monnier@iro.umontreal.ca>,
emacs-devel@gnu.org
Subject: Re: Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode [patch]
Date: Thu, 17 Jan 2013 17:51:59 +0000 [thread overview]
Message-ID: <20130117175159.GA3114@acm.acm> (raw)
In-Reply-To: <CALDnm53-mNW+KcEMQsd9e-P==St9WQTagnJe8vGJNf9_vvykJA@mail.gmail.com>
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 <acm@muc.de> 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).
next prev parent reply other threads:[~2013-01-17 17:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-13 19:28 Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode Alan Mackenzie
2013-01-13 20:48 ` Dmitry Gutov
2013-01-14 16:30 ` Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode [patch] Alan Mackenzie
2013-01-14 16:52 ` emacs24/auctex bug Camm Maguire
2013-01-14 23:58 ` Xue Fuqiao
2013-01-15 2:12 ` Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode [patch] Stefan Monnier
2013-01-15 14:08 ` Alan Mackenzie
2013-01-17 13:17 ` João Távora
2013-01-17 17:51 ` Alan Mackenzie [this message]
2013-01-17 18:31 ` Stefan Monnier
2013-01-18 12:07 ` João Távora
2013-01-18 17:09 ` Alan Mackenzie
2013-01-31 11:04 ` Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode [patch-2] Alan Mackenzie
2013-01-31 14:38 ` Stefan Monnier
2013-02-01 15:44 ` Alan Mackenzie
2013-02-01 16:28 ` Stefan Monnier
2013-02-01 19:53 ` Alan Mackenzie
2013-02-01 20:09 ` Achim Gratz
2013-02-01 20:15 ` Alan Mackenzie
2013-02-01 23:17 ` Stefan Monnier
2013-02-01 23:16 ` Stefan Monnier
2013-02-03 22:14 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130117175159.GA3114@acm.acm \
--to=acm@muc.de \
--cc=cyd@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=joaotavora@gmail.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).