Function: easy-menu-lookup-name

easy-menu-lookup-name is a byte-compiled function defined in easymenu.el.gz.

Signature

(easy-menu-lookup-name MAP NAME)

Documentation

Lookup menu item NAME in keymap MAP.

Like lookup-key except that NAME is not an array but just a single key and that NAME can be a string representing the menu item's name.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/easymenu.el.gz
(defun easy-menu-lookup-name (map name)
  "Lookup menu item NAME in keymap MAP.
Like `lookup-key' except that NAME is not an array but just a single key
and that NAME can be a string representing the menu item's name."
  (or (lookup-key map (vector (easy-menu-intern name)))
      (when (stringp name)
	;; `lookup-key' failed and we have a menu item name: look at the
	;; actual menu entries's names.
	(catch 'found
	  (map-keymap (lambda (key item)
			(if (condition-case nil (member name item)
			      (error nil))
			    ;; Found it!!  Look for it again with
			    ;; `lookup-key' so as to handle inheritance and
			    ;; to extract the actual command/keymap bound to
			    ;; `name' from the item (via get_keyelt).
			    (throw 'found (lookup-key map (vector key)))))
		      map)))))