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: Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode Date: Sun, 13 Jan 2013 19:28:54 +0000 Message-ID: <20130113192854.GA4853@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1358105763 12902 80.91.229.3 (13 Jan 2013 19:36:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Jan 2013 19:36:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 13 20:36:20 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 1TuTLr-0007dj-77 for ged-emacs-devel@m.gmane.org; Sun, 13 Jan 2013 20:36:15 +0100 Original-Received: from localhost ([::1]:58112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuTLb-0004aL-0a for ged-emacs-devel@m.gmane.org; Sun, 13 Jan 2013 14:35:59 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuTLT-0004a1-Bn for emacs-devel@gnu.org; Sun, 13 Jan 2013 14:35:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuTLL-0005Wy-O2 for emacs-devel@gnu.org; Sun, 13 Jan 2013 14:35:51 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:23605 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuTLL-0005WU-DE for emacs-devel@gnu.org; Sun, 13 Jan 2013 14:35:43 -0500 Original-Received: (qmail 94760 invoked by uid 3782); 13 Jan 2013 19:35:40 -0000 Original-Received: from acm.muc.de (pD95198DB.dip.t-dialin.net [217.81.152.219]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 13 Jan 2013 20:35:39 +0100 Original-Received: (qmail 5087 invoked by uid 1000); 13 Jan 2013 19:28:54 -0000 Content-Disposition: inline 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:156319 Archived-At: Hi, Emacs. The situation here is the direct cause of bug #11152, where in CC Mode, doc comments whose fontification is specified in a mode hook don't get fontified properly, or at all. It would be good to fix this bug for Emacs 24.3. In define-globalized-minor-mode L72-75, the newly defined -enable- function is added to both the following hooks: change-major-mode-after-body-hook after-change-major-mode-hook . (These hooks are run before and after the major mode hook.) It seems the hacker who formulated this macro was undecided whether to run the -enable- function before or after the mode hooks, so decided upon both as a compromise. This isn't harmless. In particular, running `global-font-lock-mode-enable-in-buffers' before the objc-mode-hook causes a one-time font-lock-keywords initialisation to happen before a critical initialisation has been performed by that hook. Can some means be found so that `font-lock-mode' isn't called twice? (For that matter, `global-hi-lock-mode-enable-in-buffers' doesn't need calling twice, either.) Such a means might be the addition of another parameter to define-globalized-minor-mode specifying when the -enable- call should take place. -- Alan Mackenzie (Nuremberg, Germany).