comparison lisp/emacs-lisp/lmenu.el @ 36861:79c77eec747f

(add-menu): Re-added (was erroneously removed).
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 18 Mar 2001 21:57:41 +0000
parents 8c99980d4906
children 67b464da13ec
comparison
equal deleted inserted replaced
36860:7bcec61bdbde 36861:79c77eec747f
393 (setcar item new-name) 393 (setcar item new-name)
394 (aset item 0 new-name)) 394 (aset item 0 new-name))
395 (set-menubar-dirty-flag) 395 (set-menubar-dirty-flag)
396 item)) 396 item))
397 397
398 ;; XEmacs compatibility
399 (defun add-menu (menu-path menu-name menu-items &optional before)
400 "Add a menu to the menubar or one of its submenus.
401 If the named menu exists already, it is changed.
402 MENU-PATH identifies the menu under which the new menu should be inserted.
403 It is a list of strings; for example, (\"File\") names the top-level \"File\"
404 menu. (\"File\" \"Foo\") names a hypothetical submenu of \"File\".
405 If MENU-PATH is nil, then the menu will be added to the menubar itself.
406 MENU-NAME is the string naming the menu to be added.
407 MENU-ITEMS is a list of menu item descriptions.
408 Each menu item should be a vector of three elements:
409 - a string, the name of the menu item;
410 - a symbol naming a command, or a form to evaluate;
411 - and a form whose value determines whether this item is selectable.
412 BEFORE, if provided, is the name of a menu before which this menu should
413 be added, if this menu is not on its parent already. If the menu is already
414 present, it will not be moved."
415 (or menu-name (error "must specify a menu name"))
416 (or menu-items (error "must specify some menu items"))
417 (add-menu-item-1 nil menu-path menu-name menu-items t before))
418
398 419
399 420
400 (defvar put-buffer-names-in-file-menu t) 421 (defvar put-buffer-names-in-file-menu t)
401 422
402 423