From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode [patch] Date: Thu, 17 Jan 2013 17:51:59 +0000 Message-ID: <20130117175159.GA3114@acm.acm> References: <20130113192854.GA4853@acm.acm> <20130114163003.GC3274@acm.acm> <20130115140855.GA3430@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1358446334 8624 80.91.229.3 (17 Jan 2013 18:12:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Jan 2013 18:12:14 +0000 (UTC) Cc: Chong Yidong , Stefan Monnier , emacs-devel@gnu.org To: =?iso-8859-1?Q?Jo=E3o_T=E1vora?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 17 19:12:29 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TvtkI-0002rx-Fy for ged-emacs-devel@m.gmane.org; Thu, 17 Jan 2013 18:59:22 +0100 Original-Received: from localhost ([::1]:47292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvtk2-000826-0P for ged-emacs-devel@m.gmane.org; Thu, 17 Jan 2013 12:59:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvtjw-00080a-FR for emacs-devel@gnu.org; Thu, 17 Jan 2013 12:59:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tvtjq-00076V-DY for emacs-devel@gnu.org; Thu, 17 Jan 2013 12:59:00 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:27080 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvtjq-00071g-1r for emacs-devel@gnu.org; Thu, 17 Jan 2013 12:58:54 -0500 Original-Received: (qmail 59474 invoked by uid 3782); 17 Jan 2013 17:58:49 -0000 Original-Received: from acm.muc.de (pD9519BE1.dip.t-dialin.net [217.81.155.225]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 17 Jan 2013 18:58:43 +0100 Original-Received: (qmail 3369 invoked by uid 1000); 17 Jan 2013 17:51:59 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156448 Archived-At: 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 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).