Mercurial > hg > xemacs-beta
changeset 5706:44b0b4ea5cae
Implement and document :active keyword for submenu specs.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Fri, 28 Dec 2012 17:23:25 +0900 |
parents | 9c9b07d40f20 |
children | 5fd1b9a95531 |
files | lisp/ChangeLog lisp/menubar.el man/ChangeLog man/lispref/menus.texi |
diffstat | 4 files changed, 19 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Fri Dec 28 13:03:15 2012 +0900 +++ b/lisp/ChangeLog Fri Dec 28 17:23:25 2012 +0900 @@ -1,3 +1,7 @@ +2012-12-28 Byrel Mitchell <byrel.mitchell@gmail.com> + + * menubar.el (check-menu-syntax): Implement :active in submenu specs. + 2012-08-03 Stephen J. Turnbull <stephen@xemacs.org> * menubar-items.el (default-menubar): Reorganize.
--- a/lisp/menubar.el Fri Dec 28 13:03:15 2012 +0900 +++ b/lisp/menubar.el Fri Dec 28 17:23:25 2012 +0900 @@ -79,9 +79,9 @@ (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" item))) (if (or (not (cdr menu)) (vectorp (nth 1 menu))
--- a/man/ChangeLog Fri Dec 28 13:03:15 2012 +0900 +++ b/man/ChangeLog Fri Dec 28 17:23:25 2012 +0900 @@ -1,3 +1,8 @@ +2012-12-28 Byrel Mitchell <byrel.mitchell@gmail.com> + + * lispref/menus.texi (Menu Format): + Document use of :active in submenu specs. + 2012-12-28 Stephen J. Turnbull <stephen@xemacs.org> * internals/internals.texi (Mercurial Basics):
--- a/man/lispref/menus.texi Fri Dec 28 13:03:15 2012 +0900 +++ b/man/lispref/menus.texi Fri Dec 28 17:23:25 2012 +0900 @@ -39,7 +39,7 @@ 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} @@ -64,7 +64,13 @@ @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: