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

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

Re: menu-bar-update-hook run very often


From: Stefan Monnier
Subject: Re: menu-bar-update-hook run very often
Date: 28 Mar 2004 20:48:01 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>     Normal hook run for clicks on menu bar, before displaying a submenu.
>     Can be used to update submenus whose contents should vary.

> But the hook is run much much much more often, such as when one
> switches buffers.  It certainly does not depend on a menu being
> clicked.

Indeed, if I understand the code correctly it is run everytime the menubar
is updated, which happens at least as often as switching buffer since the
menu bar is (in general) not the same in the two buffers.

An alternative to menu-bar-update-hook is to use filters in menu-items.
But as you might expect, this suffers from the same problem (although
slightly less so because in some cases Emacs does notice that the filter
does not need to be run).  And at least, using filters, you can expect that
(at some point in time) Emacs will only run the filter when really needed.


        Stefan




reply via email to

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