;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:39:08 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/emacs-lisp/easymenu.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`easymenu.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#@460 Determine when equivalent key bindings are computed for easy-menu menus.
It can take some time to calculate the equivalent key bindings that are shown
in a menu.  If the variable is on, then this calculation gives a (maybe
noticeable) delay when a mode is first entered.  If the variable is off, then
this delay will come when a menu is displayed the first time.  If you never use
menus, turn this variable off, otherwise it is probably better to keep it on.
(custom-declare-variable 'easy-menu-precalculate-equivalent-keybindings 't '(#$ . 630) :type 'boolean :group 'menu :version "20.3")
(put 'easy-menu-define 'lisp-indent-function 'defun)
#@3029 Define a menu bar submenu in maps MAPS, according to MENU.
The menu keymap is stored in symbol SYMBOL, both as its value
and as its function definition.  DOC is used as the doc string for SYMBOL.

The first element of MENU must be a string.  It is the menu bar item name.
It may be followed by the following keyword argument pairs

   :filter FUNCTION

FUNCTION is a function with one argument, the menu.  It returns the actual
menu displayed.

   :visible INCLUDE

INCLUDE is an expression; this menu is only visible if this
expression has a non-nil value.  `:include' is an alias for `:visible'.

   :active ENABLE

ENABLE is an expression; the menu is enabled for selection
whenever this expression's value is non-nil.

The rest of the elements in MENU, are menu items.

A menu item is usually a vector of three elements:  [NAME CALLBACK ENABLE]

NAME is a string--the menu item name.

CALLBACK is a command to run when the item is chosen,
or a list to evaluate when the item is chosen.

ENABLE is an expression; the item is enabled for selection
whenever this expression's value is non-nil.

Alternatively, a menu item may have the form:

   [ NAME CALLBACK [ KEYWORD ARG ] ... ]

Where KEYWORD is one of the symbols defined below.

   :keys KEYS

KEYS is a string; a complex keyboard equivalent to this menu item.
This is normally not needed because keyboard equivalents are usually
computed automatically.
KEYS is expanded with `substitute-command-keys' before it is used.

   :key-sequence KEYS

KEYS is nil, a string or a vector; nil or a keyboard equivalent to this
menu item.
This is a hint that will considerably speed up Emacs' first display of
a menu.  Use `:key-sequence nil' when you know that this menu item has no
keyboard equivalent.

   :active ENABLE

ENABLE is an expression; the item is enabled for selection
whenever this expression's value is non-nil.

   :included INCLUDE

INCLUDE is an expression; this item is only visible if this
expression has a non-nil value.

   :suffix FORM

FORM is an expression that will be dynamically evaluated and whose
value will be concatenated to the menu entry's NAME.

   :style STYLE

STYLE is a symbol describing the type of menu item.  The following are
defined:

toggle: A checkbox.
        Prepend the name with `(*) ' or `( ) ' depending on if selected or not.
radio: A radio button.
       Prepend the name with `[X] ' or `[ ] ' depending on if selected or not.
button: Surround the name with `[' and `]'.  Use this for an item in the
        menu bar itself.
anything else means an ordinary menu item.

   :selected SELECTED

SELECTED is an expression; the checkbox or radio button is selected
whenever this expression's value is non-nil.

   :help HELP

HELP is a string, the help to display for the menu item.

A menu item can be a string.  Then that string appears in the menu as
unselectable text.  A string consisting solely of hyphens is displayed
as a solid horizontal line.

A menu item can be a list with the same format as MENU.  This is a submenu.
(defalias 'easy-menu-define '(macro . #[(symbol maps doc menu) "\304\305\306	F\307\310D\n	\257E\207" [symbol doc maps menu progn defvar nil easy-menu-do-define quote] 7 (#$ . 1282)]))
(defalias 'easy-menu-do-define #[(symbol maps doc menu) "\305@A\"\n	L\210\n\306\307\310\311\312\313\314\315\nD\316\313\317\320\n\321BB\322BB\323BB\324\nDEE\nEE\257M\210\325\326\327\f!\203> \fC\202? \f\")\207" [menu keymap symbol doc maps easy-menu-create-menu lambda (event) (interactive "@e") x-popup-menu event or and symbolp funcall plist-get get ('menu-prop) (:filter) ('identity) symbol-function mapcar #[(map) "\303\304\305\306	@!\"\307	@\n9\204 \nC\202 \nK\n\310NBBB#\207" [map menu keymap define-key vector menu-bar intern menu-item menu-prop] 8] keymapp] 16])
#@420 Convert MENU to the right thing to return from a menu filter.
MENU is a menu as computed by `easy-menu-define' or `easy-menu-create-menu' or
a symbol whose value is such a menu.
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.
(defalias 'easy-menu-filter-return #[(menu &optional name) "\302!\204 :\203 \303	\206 \304\"\202\" \305!\203\" \306!A\302!\203- \307\310\"\207\207" [menu name keymapp easy-menu-create-menu "" vectorp easy-menu-convert-item easy-menu-get-map nil] 3 (#$ . 5082)])
#@215 Create a menu called MENU-NAME with items described in MENU-ITEMS.
MENU-NAME is a string, the name of the menu.  MENU-ITEMS is a list of items
possibly preceded by keyword pairs as described in `easy-menu-define'.
(defalias 'easy-menu-create-menu #[(menu-name menu-items) "\306!\307\211\211\211\211\211\211\211 !\"#\203\232 #A\203\232 \310#@\211 !\203\232 #\211$A@)#\211$AA)# \311=\203W \312\313\314\315BEE\202  \316=\203h \206d \317\202  \320=\203u \202  \321=\203\202 \202  \322=\204\220  \323=\203 \206\226 \324\202 \n\325\232?\205\n\203\263 \326\n!\204\263 \323\n!BB!\f\203\305 \326\f!\204\305 \327\f!BB!\203\321 \311!BB!	\203\335 \321	!BB!\203\351 \307!BB!\203\364 #\"\202\377 \330\"\331\332#\"\"\"!\203\333\"\334\"\"\335\"\336!#\210\".	\207" [menu-name help visible filter enable label make-sparse-keymap nil keywordp :filter lambda (menu) easy-menu-filter-return (menu) :active 'nil :label :help :included :visible 'nil 'nil easy-menu-always-true :enable append mapcar easy-menu-convert-item easy-menu-make-symbol noexp put menu-prop arg keyword prop menu menu-items x] 10 (#$ . 5783)])
(byte-code "\301B\302\301!\204\f \303\301\207" [current-load-list easy-menu-button-prefix boundp ((radio . :radio) (toggle . :toggle))] 2)
(defalias 'easy-menu-do-add-item #[(menu item &optional before) "\303!\304	@A\n$\207" [item menu before easy-menu-convert-item easy-menu-define-key-intern] 5])
(byte-code "\301B\302\301!\204 \303\304\305\"\301\207" [current-load-list easy-menu-converted-items-table boundp make-hash-table :test equal] 3)
#@364 Memoize the value returned by `easy-menu-convert-item-1' called on ITEM.
This makes key-shortcut-caching work a *lot* better when this
conversion is done from within a filter.
This also helps when the NAME of the entry is recreated each time:
since the menu is built and traversed separately, the lookup
would always fail because the key is `equal' but not `eq'.
(defalias 'easy-menu-convert-item #[(item) "\302	\"\206 \303\304!	#\207" [item easy-menu-converted-items-table gethash puthash easy-menu-convert-item-1] 4 (#$ . 7419)])
#@460 Parse an item description and add the item to a keymap.
This is the function that is used for item definition by the other easy-menu
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.
(defalias 'easy-menu-convert-item-1 #[(item) "\306\211\211\211\211\211.;\203 .\202\271.:\203d .@\211.A\307\f!\2043 \310\f\"\f\204< \311\202\271\f9\203\271\f\312N\211\203\271\n@\204^ \n\211/A@)\n\211/AA)\fK\202\271\313.!\203\265.G\2110\314V\203\201 .\314H\206\202 \315\202\202 \3111.\316H\2119?2\3063\3064.\317H\2112\203\244 \320\f!\3211!\203{\314\306\211\211\211\211\211\21156789:;<\30610<V\203|.<H;.<TH:<\314\\<;\322=\204\361 ;\323=\203\374 :\206\367 \3248\202\306 ;\325=\203:3\3114\202\306 ;\326=\203:5\3062\202\306 ;\327=\203+:\202\306 ;\330=\203=:\2068\3311\202\306 ;\332=\203N\332:\nBB\202\306 ;\333=\203\\:9\202\306 ;\334=\203j:7\202\306 ;\335=\203\306 :\206w\3366\202\306 9\203\2649;\203\236;\203\224\3379Q\202\263\340\3379PE\202\263;\203\255\340\337P9E\202\263\340\3379F7\341=\203\320;\203\307\342\343Q\202\314\340\342\343F\202\3536\203\3537=\236\2117\203\353\3447A6B\nBB5;\203Z\345\3465\"\203K\317\224\316\224W\2055\317\316\224O\316\225\317\225W\2055\316\225\306O\3475\314\224\314\225O!>?\211@\204-?\2052@?B\2115\204@\f>=?\205E>5B5+\202N\30645\203Z\3265\nBB8\203y\3508!\204y8\351\232\203r\311\202y\3238\nBB.1\203\216\3501!\204\216\3521\nBB2\204\2304\203\2613\203\2523;\204\252\3133!\203\261\3253\nBB-\202\271\353\354!\210;\203\304\347!\202\305	?\205\325\355\205\323\f\nBBB.B\207" [help remove prop label command name nil keymapp easy-menu-create-menu t menu-prop vectorp 2 'nil 1 0 easy-menu-make-symbol keywordp :included :visible 'nil :key-sequence :keys :label :active 'nil :help :suffix :style :selected 'nil " " concat button "[" "]" :button string-match "^[^\\]*\\(\\\\\\[\\([^]]+\\)]\\)[^\\]*$" intern easy-menu-always-true 'nil :enable error "Invalid menu item in easymenu" menu-item item x ilen active no-name cache cache-specified keys selected style visible suffix arg keyword count easy-menu-button-prefix cmd postfix prefix] 9 (#$ . 7962)])
#@76 Like easy-menu-define-key, but interns KEY and BEFORE if they are strings.
(defalias 'easy-menu-define-key-intern #[(menu key item &optional before) "\304	;\203 \305	!\202 	\n;\203 \305!\202 $\207" [menu key item before easy-menu-define-key intern] 6 (#$ . 10509)])
#@454 Add binding in MENU for KEY => ITEM.  Similar to `define-key-after'.
If KEY is not nil then delete any duplications.  If ITEM is nil, then
don't insert, only delete.
Optional argument BEFORE is nil or a key in MENU.  If BEFORE is not nil
put binding before BEFORE in MENU, otherwise if binding is already
present in MENU, just change it, otherwise put it last in MENU.
KEY and BEFORE don't have to be symbols, comparison is done with equal
not with eq.
(defalias 'easy-menu-define-key #[(menu key item &optional before) "?\306\211	?\205\246 \fA?\206 \307\fA!\211\204, \203L \f\211	A@)\242\232\203L \n\2043 \310\204F \f\nB\fAB\241\210\310\fA\fA\202 \n\203\240 \f\211	A@)\242\n\232\203\240 \204\201 \203\216 \f\211	AA)\211\203\216 \307\n!\204\216 \n@\242\232\204\216 \f\211	\211AA)\241\210\202 \f\211	A@)\241\210\310\fA\202 \fA\202 +\207" [item done tail inserted menu before nil keymapp t x key] 4 (#$ . 10790)])
#@42 Return true if X never evaluates to nil.
(defalias 'easy-menu-always-true #[(x) ":\203 @\301=\205 \211A@)\207\302=\206 9?\207" [x quote t] 3 (#$ . 11743)])
(byte-code "\301B\302\301!\204\f \303\301\207" [current-load-list easy-menu-item-count boundp 0] 2)
#@176 Return a unique symbol with CALLBACK as function value.
When non-nil, NOEXP indicates that CALLBACK cannot be an expression
(i.e. does not need to be turned into a function).
(defalias 'easy-menu-make-symbol #[(callback &optional noexp) "\304\305\306\"!T	\307\n!\204 \203 \n\202 \310\311\312\nFM\210	)\207" [easy-menu-item-count command callback noexp make-symbol format "menu-function-%d" keymapp lambda nil (interactive)] 5 (#$ . 12018)])
#@561 Change menu found at PATH as item NAME to contain ITEMS.
PATH is a list of strings for locating the menu that
should contain a submenu named NAME.
ITEMS is a list of menu items, as in `easy-menu-define'.
These items entirely replace the previous items in that submenu.

If the menu located by PATH has no submenu named NAME, add one.
If the optional argument BEFORE is present, add it just before
the submenu named BEFORE, otherwise add it at the end of the menu.

Either call this from `menu-bar-update-hook' or use a menu filter,
to implement dynamic menus.
(defalias 'easy-menu-change #[(path name items &optional before) "\304\305	\nB$\207" [path name items before easy-menu-add-item nil] 5 (#$ . 12474)])
(defalias 'easy-menu-remove 'ignore)
#@114 Maybe precalculate equivalent key bindings.
Do it only if `easy-menu-precalculate-equivalent-keybindings' is on.
(defalias 'easy-menu-add #[(menu &optional map) "\205\" 	9\203 \302	!\204 \303	!\203 	J\302	!\205\" \304\305	\"\207" [easy-menu-precalculate-equivalent-keybindings menu keymapp boundp x-popup-menu nil] 3 (#$ . 13230)])
#@1077 To the submenu of MAP with path PATH, add ITEM.

If an item with the same name is already present in this submenu,
then ITEM replaces it.  Otherwise, ITEM is added to this submenu.
In the latter case, ITEM is normally added at the end of the submenu.
However, if BEFORE is a string and there is an item in the submenu
with that name, then ITEM is added before that item.

MAP should normally be a keymap; nil stands for the global menu-bar keymap.
It can also be a symbol, which has earlier been used as the first
argument in a call to `easy-menu-define', or the value of such a symbol.

PATH is a list of strings for locating the submenu where ITEM is to be
added.  If PATH is nil, MAP itself is used.  Otherwise, the first
element should be the name of a submenu directly under MAP.  This
submenu is then traversed recursively with the remaining elements of PATH.

ITEM is either defined as in `easy-menu-define' or a non-nil value returned
by `easy-menu-item-present-p' or `easy-menu-remove-item' or a menu defined
earlier by `easy-menu-define' or `easy-menu-create-menu'.
(defalias 'easy-menu-add-item #[(map path item &optional before) "\306	?\205 	?\205 \n\242;\205 \n@#\n:\2036 \nA:\2036 \n\211A@)\307=\2036 \310\n@\nA\f$\207\311\n!\204H \n9\203\212 \311\nJ!\203\212 \306\n\312\"\312\f\311\n!\204Y \f\204\205 \fA\211\f:\203\205 \311\f!\204\205 \f@;\203} \f@\211\202Z \fA\f\202Y \nB*\313\n\f#\207" [map path item x before name easy-menu-get-map menu-item easy-menu-define-key-intern keymapp nil easy-menu-do-add-item tail] 6 (#$ . 13575)])
#@193 In submenu of MAP with path PATH, return true iff item NAME is present.
MAP and PATH are defined as in `easy-menu-add-item'.
NAME should be a string, the name of the element to be looked for.
(defalias 'easy-menu-item-present-p #[(map path name) "\303\304	\"\n\"\207" [map path name easy-menu-return-item easy-menu-get-map] 4 (#$ . 15152)])
#@171 From submenu of MAP with path PATH remove item NAME.
MAP and PATH are defined as in `easy-menu-add-item'.
NAME should be a string, the name of the element to be removed.
(defalias 'easy-menu-remove-item #[(map path name) "\304	\"\305\n\"\211\203 \306\n\307#\210)\207" [map path name ret easy-menu-get-map easy-menu-return-item easy-menu-define-key-intern nil] 5 (#$ . 15501)])
#@187 In menu MENU try to look for menu item with name NAME.
If a menu item is found, return (NAME . item), otherwise return nil.
If item is an old format item, a new format item is returned.
(defalias 'easy-menu-return-item #[(menu name) "\306\307\310	!!\"\311\211\211\211\211\211\242;\203\214 @A\211@;\2035 \312@DA:\203b @:\203b \211@@)\203Y \211@@)\247\203b @A9\203w \313N\211\203w \314\fBB\203 B	\313\nBBBB\202\225 \205\225 	B.\207" [menu name label cache enable ret lookup-key vector intern nil :help menu-enable :enable b item x] 7 (#$ . 15892)])
(defalias 'easy-menu-get-map-look-for-name #[(name submap) "\203 @\243\242	\232\204 @\243\243\242	\232\204 A\211\204 \207" [submap name] 3])
(defalias 'easy-menu-current-active-maps #[nil "\305 D\n\306\211\203) \f@\307@!\203\" @J\203\" A	B\fA\211\204 *\310\306	\")\207" [global-map maps minor-mode-map-alist minor #1=#:--dolist-temp--97269 current-local-map nil boundp delq] 3])
#@285 Return a sparse keymap in which to add or remove an item.
MAP and PATH are as defined in `easy-menu-add-item'.

TO-MODIFY, if non-nil, is the name of the item the caller
wants to modify in the map that we return.
In some cases we use that to select between the local and global maps.
(defalias 'easy-menu-get-map #[(map path &optional to-modify) "\301\302\215\303!\204 \304\305\"\210\207" [map found (byte-code "\306?\205 \307\310\311	\"\"\310\312\203( 9\203# \313!\204# J\202$ C\202* \314 \"\f\203X \315\211\203W @\211\203P \250\204P \316\f\"\203P \317\320\"\210A\211\2048 *\315\211\203| @\211\203s \250\204s \317\320\"\210A\211\204a *	\205\210 \321\322\323	!@\"\324!\325\206\227 \326 \n\203\245 B\202\247 #\210,\207" [map path key maps to-modify #1=#:--dolist-temp--97270 vconcat (menu-bar) mapcar intern #[(map) "\302	\"\2119\203 \303!\203 K\211\202 \207" [map key lookup-key keymapp] 4] keymapp easy-menu-current-active-maps nil easy-menu-get-map-look-for-name throw found format "%s" reverse make-sparse-keymap define-key current-local-map #2=#:--dolist-temp--97271 name newmap] 5) keymapp error "Malformed menu in easy-menu: (%s)"] 3 (#$ . 16908)])
(provide 'easymenu)
