Stephen Turnbull committed 44b0b4e

Implement and document :active keyword for submenu specs.

  • Participants
  • Parent commits 9c9b07d

Comments (0)

Files changed (4)

+2012-12-28  Byrel Mitchell  <>
+	* menubar.el (check-menu-syntax): Implement :active in submenu specs.
 2012-08-03  Stephen J. Turnbull  <>
 	* menubar-items.el (default-menubar): Reorganize.
     (setq menu (cdr menu)))
   (let (menuitem item)
     (while (keywordp (setq item (car menu)))
-      (or (memq item '(:config :included :filter :accelerator))
+      (or (memq item '(:config :included :filter :accelerator :active))
 	  (signal 'error
-		  (list "menu keyword must be :config, :included, :accelerator or :filter"
+		  (list "menu keyword must be :config, :included, :accelerator, :active or :filter"
       (if (or (not (cdr menu))
 	      (vectorp (nth 1 menu))
+2012-12-28  Byrel Mitchell  <>
+	* lispref/menus.texi (Menu Format):
+	Document use of :active in submenu specs.
 2012-12-28  Stephen J. Turnbull  <>
 	* internals/internals.texi (Mercurial Basics):


 menu if @code{popup-menu-titles} is non-@code{nil}.
 Immediately following the first element there may optionally be up
-to four keyword-value pairs, as follows:
+to five keyword-value pairs, as follows:
 @table @code
 @item :included @var{form}
 @item :accelerator @var{key}
 A menu accelerator is a keystroke which can be pressed while the menu is
 visible which will immediately activate the item.  @var{key} must be a char
-or the symbol name of a key.  @xref{Menu Accelerators}.
+or the symbol name of a key. 
+@item :active @var{form}
+@var{form} will be evaluated when the submenu is about to be displayed,
+and the menu contents will be displayed only if the result is non-@code{nil}.
+If the submenu is inactive, it will display the word "Invalid", grayed-out.
+@xref{Menu Accelerators}.
 @end table
 The rest of the menu consists of elements as follows: