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: Stefan Monnier
Subject: Re: Multiple runs of menu-bar-update-hook
Date: Fri, 28 Jul 2006 12:02:50 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> I notice that the hook is run once whenever I down-mouse-1 on the menu bar
>> (at least with lucid or motif toolkit).  This may be a stupid question, but
>> isn't it enough to run at this point?  Does emacs need to run the hook
>> during buffer editing, window motion or frame switching?  (Obviously it
>> needs to be run during buffer or window switching.)  In other words, does
>> the hook need to be run from under redisplay() itself?

> Buffer text may have a keymap or local-map property which may define
> specific menu-items (even top-level items) that are specific to that
> buffer position.

> So even just moving point must call the update hook.

Better yet: the keymap may have dynamic elements (computed by evaluating
arbitrary elisp code) so it can change even if point is moved within an area
with the same text properties, or even without moving point.
But yes, requiring the use of force-mode-line-update may be a better
solution to force a recomputation of the menu-bar.


        Stefan




reply via email to

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