;ELC ;;; compiled by roland@churchy.gnu.ai.mit.edu on Fri May 12 12:23:57 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/lmenu.el ;;; emacs version 19.28.91.1. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/gd/gnu/emacs/19.0/lisp/lmenu.el' was compiled for Emacs 19")) (byte-code " B" [current-menubar current-load-list recompute-lucid-menubar] 2) (defalias 'recompute-lucid-menubar #[nil " ŏ#É" [define-key lucid-menubar-map [menu-bar] nil (make-lucid-menu-keymap "menu-bar" current-menubar) ((error (byte-code "!!\fƉ" [message "Invalid data in current-menubar moved to lucid-failing-menubar" sit-for 1 current-menubar lucid-failing-menubar nil] 2))) lucid-menu-bar-dirty-flag] 6]) (byte-code "!  B  B B" [boundp lucid-menubar-map make-sparse-keymap current-load-list current-menubar minor-mode-map-alist] 2) (defalias 'set-menubar-dirty-flag #[nil " " [force-mode-line-update t lucid-menu-bar-dirty-flag] 2]) (byte-code "! B! BŇ" [boundp add-menu-item-count 0 current-load-list make-lucid-menu-keymap-disable nil] 2) (defalias 'make-lucid-menu-keymap #[(menu-name menu-items) " !\f!\f@ʼn ;4 \"-̂/ T :L @ A\" @T !T\"!T H H9{MFM GWS H= TH#\\ H=\\ H=\\ H=\\ H=\\ H9( H!!U( H\"UG H<# G H\")f\nD\nABzz\n!!B#,\fA\f\n)" [make-sparse-keymap menu-name menu reverse menu-items nil callback name command item string-match "^-+$" "" make-lucid-menu-keymap vectorp make-symbol format "menu-function-%d" add-menu-item-count 0 1 lambda (interactive) 2 i :active put menu-enable make-lucid-menu-keymap-disable :suffix :keys :style :selected string-to-char symbol-name 58 error "Unrecognized menu item keyword: %S" "Unexpected menu item value: %S" define-key vector intern] 6]) #@2728 Pop up the given menu. A menu is a list of menu items, strings, and submenus. The first element of a menu must be a string, which is the name of the menu. This is the string that will be displayed in the parent menu, if any. For toplevel menus, it is ignored. This string is not displayed in the menu itself. A menu item is a vector containing: - the name of the menu item (a string); - the `callback' of that item; - a list of keywords with associated values: - :active active-p a form specifying whether this item is selectable; - :suffix suffix a string to be appended to the name as an `argument' to the command, like `Kill Buffer NAME'; - :keys command-keys a string, suitable for `substitute-command-keys', to specify the keyboard equivalent of a command when the callback is a form (this is not necessary when the callback is a symbol, as the keyboard equivalent is computed automatically in that case); - :style style a symbol: nil for a normal menu item, `toggle' for a toggle button (a single option that can be turned on or off), or `radio' for a radio button (one of a group of mutually exclusive options); - :selected form for `toggle' or `radio' style, a form that specifies whether the button will be in the selected state. Alternately, the vector may contain exactly 3 or 4 elements, with the third element specifying `active-p' and the fourth specifying `suffix'. If the `callback' of a menu item is a symbol, then it must name a command. It will be invoked with `call-interactively'. If it is a list, then it is evaluated with `eval'. If an element of a menu is a string, then that string will be presented in the menu as unselectable text. If an element of a menu is a string consisting solely of hyphens, then that item will be presented as a solid horizontal line. If an element of a menu is a list, it is treated as a submenu. The name of that submenu (the first element in the list) will be used as the name of the item representing this menu on the parent. The syntax, more precisely: form := command := callback := command | form active-p := text := name := suffix := command-keys := object-style := 'nil' | 'toggle' | 'radio' keyword := ':active' active-p | ':suffix' suffix | ':keys' command-keys | ':style' object-style | ':selected' form menu-item := '[' name callback active-p [ suffix ] ']' | '[' name callback [ keyword ]+ ']' menu := '(' name [ menu-item | menu | text ]+ ')' (defalias 'popup-menu #[(menu-desc) " @ A\" ÉOA@AAD@D\"O \"\"\f\f!H\f\f!," [make-lucid-menu-keymap menu-desc mouse-pixel-position nil cmd answer pos menu x-popup-menu lookup-key apply vector keymapp call-interactively] 6 (#$ . 2222)]) #@1159 Pop up a dialog box. A dialog box description is a list. - The first element of the list is a string to display in the dialog box. - The rest of the elements are descriptions of the dialog box's buttons. Each one is a vector of three elements: - The first element is the text of the button. - The second element is the `callback'. - The third element is t or nil, whether this button is selectable. If the `callback' of a button is a symbol, then it must name a command. It will be invoked with `call-interactively'. If it is a list, then it is evaluated with `eval'. One (and only one) of the buttons may be `nil'. This marker means that all following buttons should be flushright instead of flushleft. The syntax, more precisely: form := command := callback := command | form active-p := name := partition := 'nil' button := '[' name callback active-p ']' dialog := '(' name [ button ]+ [ partition [ button ]+ ] ')' (defalias 'popup-dialog-box #[(data) "@A I @\fBB @H @H @H\n \f\n<\f B>\f\fB+ A\fB\"d 9a !d !-" [data nil meaning choice converted tail name 0 1 2 enable callback item x-popup-dialog t call-interactively eval] 6 (#$ . 5245)]) (byte-code "\nB" [nil default-menubar current-load-list] 2) #@40 Set the default menubar to be menubar. (defalias 'set-menubar #[(menubar) " !\" " [set-default current-menubar copy-sequence menubar set-menubar-dirty-flag] 4 (#$ . 6756)]) #@45 Set the buffer-local menubar to be menubar. (defalias 'set-buffer-menubar #[(menubar) "! ! " [make-local-variable current-menubar copy-sequence menubar set-menubar-dirty-flag] 2 (#$ . 6941)]) #@177 Searches MENUBAR for item given by ITEM-PATH-LIST. Returns (ITEM . PARENT), where PARENT is the immediate parent of the item found. Signals an error if the item is not found. (defalias 'find-menu-item #[(menubar item-path-list &optional parent) " \"\f:??\f]@T @@!2@HC@;?@C@@T@ʼnA A:tA A#D\" @D\"B*" [parent mapcar downcase item-path-list menubar nil result rest vectorp 0 find-menu-item signal error "not a submenu" "no such submenu"] 5 (#$ . 7147)]) #@312 Make the named menu item be unselectable. PATH is a list of strings which identify the position of the menu item in the menu hierarchy. ("File" "Save") means the menu item called "Save" under the toplevel "File" menu. ("Menu" "Foo" "Item") means the menu item called "Item" under the "Foo" submenu of "Menu". (defalias 'disable-menu-item #[(path) " \"@\fA \"ɂ D\" :+! I ," [current-menubar menubar find-menu-item path pair item menu signal error "No such menu item" "No such menu" "can't disable menus, only menu items" 2 nil set-menubar-dirty-flag] 5 (#$ . 7707)]) #@310 Make the named menu item be selectable. PATH is a list of strings which identify the position of the menu item in the menu hierarchy. ("File" "Save") means the menu item called "Save" under the toplevel "File" menu. ("Menu" "Foo" "Item") means the menu item called "Item" under the "Foo" submenu of "Menu". (defalias 'enable-menu-item #[(path) " \"@\fA \"ɂ D\" :, \" I ," [current-menubar menubar find-menu-item path pair item menu signal error "No such menu item" "No such menu" "%S is a menu, not a menu item" 2 t set-menubar-dirty-flag] 5 (#$ . 8317)]) (defalias 'add-menu-item-1 #[(item-p menu-path item-name item-data enabled-p before) " ŏ< AC\"@'\fD\" \f\n\n=L@C\"@VA@C\"@h!A~A@~Aj@CCA)A9*\n (# B C\"@A@= ABA'\n= @=  B' C*@ I ??IL    +" [before current-menubar menubar nil (byte-code " \n\"@" [find-menu-item menubar menu-path] 3) ((error)) menu find-menu-item item-name signal error "not a submenu" menu-path item so-far rest rest2 "Trying to modify a menu that doesn't exist" item-p vector item-data enabled-p added-before t 1 2 set-menubar-dirty-flag] 5]) #@884 Add a menu item to some menu, creating the menu first if necessary. If the named item exists already, it is changed. MENU-PATH identifies the menu under which the new menu item should be inserted. It is a list of strings; for example, ("File") names the top-level "File" menu. ("File" "Foo") names a hypothetical submenu of "File". ITEM-NAME is the string naming the menu item to be added. FUNCTION is the command to invoke when this menu item is selected. If it is a symbol, then it is invoked with `call-interactively', in the same way that functions bound to keys are invoked. If it is a list, then the list is simply evaluated. ENABLED-P controls whether the item is selectable or not. BEFORE, if provided, is the name of a menu item before which this item should be added, if this item is not on the menu already. If the item is already present, it will not be moved. (defalias 'add-menu-item #[(menu-path item-name function enabled-p &optional before) "! !  &" [menu-path error "must specify a menu path" item-name "must specify an item name" add-menu-item-1 t function enabled-p before] 7 (#$ . 9679)]) #@322 Remove the named menu item from the menu hierarchy. PATH is a list of strings which identify the position of the menu item in the menu hierarchy. ("File" "Save") means the menu item called "Save" under the toplevel "File" menu. ("Menu" "Foo" "Item") means the menu item called "Item" under the "Foo" submenu of "Menu". (defalias 'delete-menu-item #[(path) " \"@\fA  ??2=( \". \" ," [current-menubar menubar find-menu-item path pair item menu delq set-menubar-dirty-flag] 4 (#$ . 10829)]) #@390 Change the string of the specified menu item. PATH is a list of strings which identify the position of the menu item in the menu hierarchy. ("File" "Save") means the menu item called "Save" under the toplevel "File" menu. ("Menu" "Foo" "Item") means the menu item called "Item" under the "Foo" submenu of "Menu". NEW-NAME is the string that the menu item will be printed as from now on. (defalias 'relabel-menu-item #[(path new-name) ";\fD\"\f \"@ A\n 4\n.̂/D\" :I @;I O I  ," [new-name signal wrong-type-argument stringp current-menubar menubar find-menu-item path pair item menu error "No such menu item" "No such menu" 0 set-menubar-dirty-flag] 5 (#$ . 11359)]) #@893 Add a menu to the menubar or one of its submenus. If the named menu exists already, it is changed. MENU-PATH identifies the menu under which the new menu should be inserted. It is a list of strings; for example, ("File") names the top-level "File" menu. ("File" "Foo") names a hypothetical submenu of "File". If MENU-PATH is nil, then the menu will be added to the menubar itself. MENU-NAME is the string naming the menu to be added. MENU-ITEMS is a list of menu item descriptions. Each menu item should be a vector of three elements: - a string, the name of the menu item; - a symbol naming a command, or a form to evaluate; - and a form whose value determines whether this item is selectable. BEFORE, if provided, is the name of a menu before which this menu should be added, if this menu is not on its parent already. If the menu is already present, it will not be moved. (defalias 'add-menu #[(menu-path menu-name menu-items &optional before) "! !  &" [menu-name error "must specify a menu name" menu-items "must specify some menu items" add-menu-item-1 nil menu-path t before] 7 (#$ . 12086)]) (byte-code "! B !!" [boundp put-buffer-names-in-file-menu t current-load-list set-menubar default-menubar provide lmenu] 2)