From: Mike Kupfer <mike.kupfer(a)xemacs.org>
Date: Fri, 09 Nov 2012 20:37:16 -0800
jeff-xemacs(a)delphioutpost.com wrote:
I've been having trouble with cc based modes for the past year.
After I open a .cc file then every other mode becomes infected with
c-before-change and c-after-change hooks.
Yes, I've run into that, too. I've opened a bug on it[1].
I'm on 21.4.22, but I sort of doubt that matters.
It does, actually. I don't know why.
So what is different about 21.5? Is add-hook different, or is the
after-change-function hook interaction different?
Footnotes:
[1]
http://tracker.xemacs.org/XEmacs/its/issue844
The problem is that c-emacs-features has 'add-hook-local in cc-defs.el
This code returns t in 21.4.22 which causes 'add-hook-local to be
added to c-emacs-features
(let ((buf1 (generate-new-buffer " test1"))
(buf2 (generate-new-buffer " test2"))
changed)
(save-excursion ; Needed for XEmacs's byte compiler
(set-buffer buf1)
(add-hook 'after-change-functions
(lambda (beg end old-len) (setq changed t))
nil
t)
(set-buffer buf2)
(insert ?c)
(set-buffer buf1)
(remove-hook 'after-change-functions
(lambda (beg end old-len) (setq changed t))
t)
(kill-buffer buf1)
(kill-buffer buf2)
(not changed)))
In 21.4.22 the add-hook sets the global hook. There seems to be
something preventing the after-change-functions hook from becoming
active immediately after it is added.
-jeff
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta