# HG changeset patch # User Stefan Monnier # Date 1100103620 0 # Node ID 28acd37455bba95e6c3a8132d57a7b4ce02c6a2a # Parent b7ee8419031bf3a6b88b3c2912fe26d5e408de73 (easy-menu-add-item): Use keymap-prompt. Simplify. diff -r b7ee8419031b -r 28acd37455bb lisp/emacs-lisp/easymenu.el --- a/lisp/emacs-lisp/easymenu.el Wed Nov 10 15:15:43 2004 +0000 +++ b/lisp/emacs-lisp/easymenu.el Wed Nov 10 16:20:20 2004 +0000 @@ -523,15 +523,10 @@ (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)