From: Richard M. Stallman Date: Thu, 15 Aug 2002 20:21:32 +0000 (+0000) Subject: (easy-menu-return-item): Only return nil if there is no binding. X-Git-Tag: emacs-pretest-21.2.91~120 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7c5ed7d36ef526fc49141ee592a47417f83742c4;p=emacs.git (easy-menu-return-item): Only return nil if there is no binding. --- diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 7d0230b9ec7..d0bdef92a79 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -514,11 +514,9 @@ NAME should be a string, the name of the element to be removed." "In menu MENU try to look for menu item with name NAME. If a menu item is found, return (NAME . item), otherwise return nil. If item is an old format item, a new format item is returned." - (let ((item (lookup-key menu (vector (intern name)))) + (let ((item (lookup-key menu (vector (intern name))))b ret enable cache label) (cond - ((or (keymapp item) (eq (car-safe item) 'menu-item)) - (cons name item)) ; Keymap or new menu format ((stringp (car-safe item)) ;; This is the old menu format. Convert it to new format. (setq label (car item)) @@ -532,7 +530,9 @@ If item is an old format item, a new format item is returned." (and (symbolp item) (setq enable (get item 'menu-enable)) ; Got enable (setq ret (cons :enable (cons enable ret)))) (if cache (setq ret (cons cache ret))) - (cons name (cons 'menu-enable (cons label (cons item ret)))))))) + (cons name (cons 'menu-enable (cons label (cons item ret))))) + (item ; (or (symbolp item) (keymapp item) (eq (car-safe item) 'menu-item)) + (cons name item))))) (defun easy-menu-get-map-look-for-name (name submap) (while (and submap (not (or (equal (car-safe (cdr-safe (car submap))) name)