unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Dynamically modifying menu entries
@ 2010-07-19  5:15 Michael Mauger
  2010-07-19  6:18 ` Drew Adams
  2010-07-20 11:18 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Mauger @ 2010-07-19  5:15 UTC (permalink / raw)
  To: Emacs Devel

I am building a menu using `easy-menu-define' with a submenu whose entries are 
dependent on the entries in a list in the package.  The contents of the list may 
change and based on those changes the contents of the submenu may change.  This 
is not as simple as enabling/disabling menu entries; it involves adding and 
removing entries based on the contents of the separate list.

I have one submenu for which I have a separate API to maintain the list and 
corresponding submenu contents.  In another case, the API feels like overkill.

I've tried the :filter function and rather than filtering out existing menu 
entries I return an augmented list of entries.  It worked on Gnome but I'm not 
sure that it is an appropriate way of dynamically populating a submenu.  It also 
does appear that the submenu doesn't get refreshed as frequently as I'd like.  
Ideally, I'd like to be able to populate the submenu when it's selected rather 
than having to predefine the menu contents.

What am I missing, or is using the :filter handler the way to go? 

TIA



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-20 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-19  5:15 Dynamically modifying menu entries Michael Mauger
2010-07-19  6:18 ` Drew Adams
2010-07-20 11:18 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).