summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/easymenu.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2005-06-06 02:39:45 +0000
committerMiles Bader <miles@gnu.org>2005-06-06 02:39:45 +0000
commitfdffd346262841cb194225ea0acd8059c57ec2d4 (patch)
treed8b3699131f7d1b94bc46c7d8be62af6b8b5ebfe /lisp/emacs-lisp/easymenu.el
parenta5c508fe3a3f456c987283156315d0384d38fe9e (diff)
parenta9b4333620eb259e974445066a8e64cee0c21d69 (diff)
downloademacs-fdffd346262841cb194225ea0acd8059c57ec2d4.tar.gz
emacs-fdffd346262841cb194225ea0acd8059c57ec2d4.tar.bz2
emacs-fdffd346262841cb194225ea0acd8059c57ec2d4.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-57
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 324-352) - Merge from gnus--rel--5.10 - Update from CVS - etc/emacs-buffer.gdb: Remove RCS keywords * gnus--rel--5.10 (patch 70-79) - Update from CVS - Merge from emacs--cvs-trunk--0
Diffstat (limited to 'lisp/emacs-lisp/easymenu.el')
-rw-r--r--lisp/emacs-lisp/easymenu.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index b3160c9b752..982570fb348 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -1,6 +1,7 @@
;;; easymenu.el --- support the easymenu interface for defining a menu
-;; Copyright (C) 1994,96,98,1999,2000,2004 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1996, 1998, 1999, 2000, 2004, 2005
+;; Free Software Foundation, Inc.
;; Keywords: emulations
;; Author: Richard Stallman <rms@gnu.org>
@@ -534,7 +535,7 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'."
(easy-menu-do-add-item map item before)))
(defun easy-menu-item-present-p (map path name)
- "In submenu of MAP with path PATH, return true iff item NAME is present.
+ "In submenu of MAP with path PATH, return non-nil iff item NAME is present.
MAP and PATH are defined as in `easy-menu-add-item'.
NAME should be a string, the name of the element to be looked for."
(easy-menu-return-item (easy-menu-get-map map path) name))
@@ -552,7 +553,14 @@ 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 (easy-menu-intern name))))
+ ;; The call to `lookup-key' also calls the C function `get_keyelt' which
+ ;; looks inside a menu-item to only return the actual command. This is
+ ;; not what we want here. We should either add an arg to lookup-key to be
+ ;; able to turn off this "feature", or else we could use map-keymap here.
+ ;; In the mean time, I just use `assq' which is an OK approximation since
+ ;; menus are rarely built from vectors or char-tables.
+ (let ((item (or (cdr (assq name menu))
+ (lookup-key menu (vector (easy-menu-intern name)))))
ret enable cache label)
(cond
((stringp (car-safe item))