# HG changeset patch # User Richard M. Stallman # Date 872737458 0 # Node ID c24b4ef205256a61a9b84df46ab7da699bd71b68 # Parent 167f4700890ab6061a164b537d61ac5ca11e47c8 (easy-menu-create-keymaps): If nil is given as the enable condition, always disable the command. diff -r 167f4700890a -r c24b4ef20525 lisp/emacs-lisp/easymenu.el --- a/lisp/emacs-lisp/easymenu.el Thu Aug 28 02:53:44 1997 +0000 +++ b/lisp/emacs-lisp/easymenu.el Thu Aug 28 03:04:18 1997 +0000 @@ -142,7 +142,7 @@ (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 @@ (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 @@ (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)))