mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-19 11:27:34 +00:00
(easy-menu-filter-return): Handle the
case where the filter returns a single menu-entry.
This commit is contained in:
parent
e27c6c804b
commit
2cc562bc83
1 changed files with 8 additions and 2 deletions
|
|
@ -184,11 +184,17 @@ In Emacs a menu filter must return a menu (a keymap), in XEmacs a filter must
|
|||
return a menu items list (without menu name and keywords).
|
||||
This function returns the right thing in the two cases.
|
||||
If NAME is provided, it is used for the keymap."
|
||||
(when (and (not (keymapp menu)) (consp menu))
|
||||
(cond
|
||||
((and (not (keymapp menu)) (consp menu))
|
||||
;; If it's a cons but not a keymap, then it can't be right
|
||||
;; unless it's an XEmacs menu.
|
||||
(setq menu (easy-menu-create-menu (or name "") menu)))
|
||||
(easy-menu-get-map menu nil)) ; Get past indirections.
|
||||
((vectorp menu)
|
||||
;; It's just a menu entry.
|
||||
(setq menu (cdr (easy-menu-convert-item menu)))))
|
||||
(if (keymapp menu)
|
||||
(easy-menu-get-map menu nil) ; Get past indirections.
|
||||
menu))
|
||||
|
||||
;;;###autoload
|
||||
(defun easy-menu-create-menu (menu-name menu-items)
|
||||
|
|
|
|||
Loading…
Reference in a new issue