148 |
|
|
149 |
A menu item can be a list with the same format as MENU. This is a submenu." |
A menu item can be a list with the same format as MENU. This is a submenu." |
150 |
`(progn |
`(progn |
151 |
(defvar ,symbol nil ,doc) |
,(if symbol `(defvar ,symbol nil ,doc)) |
152 |
(easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu))) |
(easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu))) |
153 |
|
|
154 |
;;;###autoload |
;;;###autoload |
266 |
easy-menu-converted-items-table))) |
easy-menu-converted-items-table))) |
267 |
|
|
268 |
(defun easy-menu-convert-item-1 (item) |
(defun easy-menu-convert-item-1 (item) |
269 |
"Parse an item description and add the item to a keymap. |
"Parse an item description and convert it to a menu keymap element. |
270 |
This is the function that is used for item definition by the other easy-menu |
ITEM defines an item as in `easy-menu-define'." |
|
functions. |
|
|
MENU is a sparse keymap i.e. a list starting with the symbol `keymap'. |
|
|
ITEM defines an item as in `easy-menu-define'. |
|
|
Optional argument BEFORE is nil or a key in MENU. If BEFORE is not nil |
|
|
put item before BEFORE in MENU, otherwise if item is already present in |
|
|
MENU, just change it, otherwise put it last in MENU." |
|
271 |
(let (name command label prop remove help) |
(let (name command label prop remove help) |
272 |
(cond |
(cond |
273 |
((stringp item) ; An item or separator. |
((stringp item) ; An item or separator. |
454 |
|
|
455 |
Either call this from `menu-bar-update-hook' or use a menu filter, |
Either call this from `menu-bar-update-hook' or use a menu filter, |
456 |
to implement dynamic menus." |
to implement dynamic menus." |
457 |
(easy-menu-add-item nil path (cons name items) before)) |
(easy-menu-add-item nil path (easy-menu-create-menu name items) before)) |
458 |
|
|
459 |
;; XEmacs needs the following two functions to add and remove menus. |
;; XEmacs needs the following two functions to add and remove menus. |
460 |
;; In Emacs this is done automatically when switching keymaps, so |
;; In Emacs this is done automatically when switching keymaps, so |