emacs-devel
[Top][All Lists]
Advanced

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

Dynamically modifying menu entries


From: Michael Mauger
Subject: Dynamically modifying menu entries
Date: Sun, 18 Jul 2010 22:15:50 -0700 (PDT)

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



reply via email to

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