emacs-pretest-bug
[Top][All Lists]
Advanced

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

RE: Multiple runs of menu-bar-update-hook


From: Marshall, Simon
Subject: RE: Multiple runs of menu-bar-update-hook
Date: Fri, 28 Jul 2006 09:43:40 +0100

> As for running menu-bar-update-hook multiple times when multiple
> frames update their menu bars, I see there's no way for the hook
> functions to tell which frame they are being called "for".  So there
> is no possible use in running it once for each frame.
> 
> This patch should get rid of that.  Does it?

Yes, it does seem to, there are multiple runs but they only occur in one
frame.

I have another gem that might provide some insight:

src/emacs -Q
(setq bar 0)
(defun foo ()
  (message "foo: %s %d" (buffer-name) (setq bar (1+ bar))))
(add-hook 'menu-bar-update-hook 'foo)
M-x eval-buffer RET
C-x 5 2

Now double mouse-1 on "message".  The hook gets run multiple times (4 with
your patch, 8 with CVS emacs).  This is as I've already reported.

Now, without doing anything else, quickly do double mouse-1 on "message"
again.  After the initial run multiple times as before, I see the hook being
run repeatedly, perhaps twice a second.  Note that it doesn't always happen
like this (which is why I hadn't noticed it before) and you might need to
try it again to reproduce it.  Before you ask, disabling Options > Blinking
Cursor seems to prevent it happening with a twist: there is a run of the
hook after a pause (half a second?) but it is not repeated.  I guess this is
a quirk of the way blinking cursor is implemented.




reply via email to

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