summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/easymenu.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2004-11-10 16:20:20 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2004-11-10 16:20:20 +0000
commitfe6ca60c2157771d8f53cd06b9e13908925e1a21 (patch)
tree968ee5dbd77d745e62eed9070d6f15bcba2333a2 /lisp/emacs-lisp/easymenu.el
parentd0db69919bbb513ab0eaebb2aca7209fb0e8d394 (diff)
downloademacs-fe6ca60c2157771d8f53cd06b9e13908925e1a21.tar.gz
(easy-menu-add-item): Use keymap-prompt. Simplify.
Diffstat (limited to 'lisp/emacs-lisp/easymenu.el')
-rw-r--r--lisp/emacs-lisp/easymenu.el11
1 files changed, 3 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 730236989a4..b0f3b9b9d3e 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -523,15 +523,10 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'."
(easy-menu-define-key map (easy-menu-intern (car item))
(cdr item) before)
(if (or (keymapp item)
- (and (symbolp item) (keymapp (symbol-value item))))
+ (and (symbolp item) (keymapp (symbol-value item))
+ (setq item (symbol-value item))))
;; Item is a keymap, find the prompt string and use as item name.
- (let ((tail (easy-menu-get-map item nil)) name)
- (if (not (keymapp item)) (setq item tail))
- (while (and (null name) (consp (setq tail (cdr tail)))
- (not (keymapp tail)))
- (if (stringp (car tail)) (setq name (car tail)) ; Got a name.
- (setq tail (cdr tail))))
- (setq item (cons name item))))
+ (setq item (cons (keymap-prompt item) item)))
(easy-menu-do-add-item map item before)))
(defun easy-menu-item-present-p (map path name)