emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Redundant (harmful) duplication of run-hooks in define-globalized-minor-


From: Alan Mackenzie
Subject: Redundant (harmful) duplication of run-hooks in define-globalized-minor-mode
Date: Sun, 13 Jan 2013 19:28:54 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

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).



reply via email to

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