diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-08-28 03:04:18 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-08-28 03:04:18 +0000 |
commit | a9f8f395d55e4c8c2b96693086106485c39e07e8 (patch) | |
tree | 72a2f8418a7f939062299a9e7d7f735682dff6dc /lisp/emacs-lisp/easymenu.el | |
parent | 4c69a3beaf258c287fc3efcc40e3defb1f0e9ec2 (diff) | |
download | emacs-a9f8f395d55e4c8c2b96693086106485c39e07e8.tar.gz |
(easy-menu-create-keymaps): If nil is
given as the enable condition, always disable the command.
Diffstat (limited to 'lisp/emacs-lisp/easymenu.el')
-rw-r--r-- | lisp/emacs-lisp/easymenu.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index b172e131763..081780bd465 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -142,7 +142,7 @@ is a list of menu items, as above." (if (and (symbolp keyword) (= ?: (aref (symbol-name keyword) 0))) (let ((count 2) - style selected active keys + style selected active keys active-specified arg) (while (> (length item) count) (setq keyword (aref item count)) @@ -151,7 +151,8 @@ is a list of menu items, as above." (cond ((eq keyword ':keys) (setq keys arg)) ((eq keyword ':active) - (setq active arg)) + (setq active (or arg ''nil) + active-specified t)) ((eq keyword ':suffix) (setq item-string (concat item-string " " arg))) @@ -185,8 +186,10 @@ is a list of menu items, as above." (setcar (car old-items) (concat " " (car (car old-items)))) (setq old-items (cdr old-items))))) - (if active (put command 'menu-enable active))) - (put command 'menu-enable keyword))) + (if active-specified (put command 'menu-enable active))) + ;; If the third element is nil, + ;; make this command always disabled. + (put command 'menu-enable (or keyword ''nil)))) (if (symbolp callback) (fset command callback) (fset command (list 'lambda () '(interactive) callback))) |