(make-lucid-menu-keymap): Allow any form as the enabler.

This commit is contained in:
Richard M. Stallman 1994-05-28 21:54:36 +00:00
parent 16776e8d91
commit e24cb6c5c4

View file

@ -62,7 +62,7 @@
(while menu-items (while menu-items
(let* ((item (car menu-items)) (let* ((item (car menu-items))
(callback (if (vectorp item) (aref item 1))) (callback (if (vectorp item) (aref item 1)))
command enabler name) command name)
(cond ((stringp item) (cond ((stringp item)
(setq command nil) (setq command nil)
(setq name (if (string-match "^-+$" item) "" item))) (setq name (if (string-match "^-+$" item) "" item)))
@ -72,11 +72,8 @@
((vectorp item) ((vectorp item)
(setq command (make-symbol (format "menu-function-%d" (setq command (make-symbol (format "menu-function-%d"
add-menu-item-count))) add-menu-item-count)))
(setq enabler (make-symbol (format "menu-function-%d-enabler"
add-menu-item-count)))
(setq add-menu-item-count (1+ add-menu-item-count)) (setq add-menu-item-count (1+ add-menu-item-count))
(put command 'menu-enable enabler) (put command 'menu-enable (aref item 2))
(set enabler (aref item 2))
(setq name (aref item 0)) (setq name (aref item 0))
(if (symbolp callback) (if (symbolp callback)
(fset command callback) (fset command callback)
@ -421,7 +418,7 @@ MENU-ITEMS is a list of menu item descriptions.
Each menu item should be a vector of three elements: Each menu item should be a vector of three elements:
- a string, the name of the menu item; - a string, the name of the menu item;
- a symbol naming a command, or a form to evaluate; - a symbol naming a command, or a form to evaluate;
- and t or nil, whether this item is selectable. - and a form whose value determines whether this item is selectable.
BEFORE, if provided, is the name of a menu before which this menu should BEFORE, if provided, is the name of a menu before which this menu should
be added, if this menu is not on its parent already. If the menu is already be added, if this menu is not on its parent already. If the menu is already
present, it will not be moved." present, it will not be moved."