On Tue, Sep 23, 2014 at 9:51 PM, Jerry James <james(a)xemacs.org> wrote:
And sorry for not adding "CC Mode" to the subject. I
thought this was
purely a lazy-lock problem. It might turn out to be just that
yet.....
Actually, this may turn out to be a purely Fedora problem. I finally
realized that the previous XEmacs package maintainer for Fedora, Ville,
created a default.el file to which he added this in 2007:
;; turn on syntax highlighting by default if lazy-lock is available
(when (fboundp 'turn-on-lazy-lock)
(require 'font-lock)
;; use lazy-lock by default if lazy-shot is not enabled
(remove-hook 'font-lock-mode-hook 'turn-on-lazy-lock)
(add-hook 'font-lock-mode-hook
(function
(lambda ()
(unless (and (boundp 'lazy-shot-mode) lazy-shot-mode)
(turn-on-lazy-lock))))
t))
So now, when cc-mode calls (make-local-hook 'font-lock-mode-hook), the hook
already has a value, which becomes its default global value. When I look
at font-lock-mode-hook in a C buffer, it has this value:
(c-after-font-lock-init t)
where the 't' indicates that the global value (which sets lazy-lock-mode)
should also be run. So here's what happens. When (run-hooks
'font-lock-mode-hook) is run, it calls c-after-font-lock-init, which
removes c-after-change from after-change-functions, then puts it back onto
after-change-functions, at the beginning. Then we run the global part of
font-lock-mode-hook, which calls (turn-on-lazy-lock), which calls
(lazy-lock-mode t), which calls (lazy-lock-install), which calls
(lazy-lock-install-hooks), which adds lazy-lock-after-change to the *front*
of after-change-functions.
Unless you apply the patch I sent in my previous message, which makes it
add lazy-lock-after-change to the *end* of after-change functions. I think
that patch is right. I'll send it to xemacs-patches momentarily.
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta