update.
[chise/xemacs-chise.git.1] / man / lispref / menus.texi
index 3a815dd..4a00115 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the XEmacs Lisp Reference Manual.
 @c -*-texinfo-*-
 @c This is part of the XEmacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. 
+@c Copyright (C) 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc.
 @c Copyright (C) 1995 Sun Microsystems.
 @c See the file lispref.texi for copying conditions.
 @setfilename ../../info/menu.info
 @c Copyright (C) 1995 Sun Microsystems.
 @c See the file lispref.texi for copying conditions.
 @setfilename ../../info/menu.info
@@ -9,14 +9,14 @@
 @cindex menu
 
 @menu
 @cindex menu
 
 @menu
-* Menu Format::                Format of a menu description.
-* Menubar Format::     How to specify a menubar.
-* Menubar::            Functions for controlling the menubar.
-* Modifying Menus::    Modifying a menu description.
-* Pop-Up Menus::       Functions for specifying pop-up menus.
-* Menu Filters::       Filter functions for the default menubar.
-* Menu Accelerators::  Using and controlling menu accelerator keys
-* Buffers Menu::       The menu that displays the list of buffers.
+* Menu Format::         Format of a menu description.
+* Menubar Format::      How to specify a menubar.
+* Menubar::             Functions for controlling the menubar.
+* Modifying Menus::     Modifying a menu description.
+* Pop-Up Menus::        Functions for specifying pop-up menus.
+* Menu Filters::        Filter functions for the default menubar.
+* Menu Accelerators::   Using and controlling menu accelerator keys
+* Buffers Menu::        The menu that displays the list of buffers.
 @end menu
 
 @node Menu Format
 @end menu
 
 @node Menu Format
@@ -241,9 +241,9 @@ For example:
 
 @example
  ("File"
 
 @example
  ("File"
-  :filter file-menu-filter     ; file-menu-filter is a function that takes
-                               ; one argument (a list of menu items) and
-                               ; returns a list of menu items
+  :filter file-menu-filter      ; file-menu-filter is a function that takes
+                                ; one argument (a list of menu items) and
+                                ; returns a list of menu items
   [ "Save As..."    write-file]
   [ "Revert Buffer" revert-buffer :active (buffer-modified-p) ]
   [ "Read Only"     toggle-read-only :style toggle :selected buffer-read-only ]
   [ "Save As..."    write-file]
   [ "Revert Buffer" revert-buffer :active (buffer-modified-p) ]
   [ "Read Only"     toggle-read-only :style toggle :selected buffer-read-only ]
@@ -366,7 +366,7 @@ also specifies a particular item to be modified.  For example,
 top-level ``File'' menu.  @code{("Menu" "Foo" "Item")} means the menu
 item called ``Item'' under the ``Foo'' submenu of ``Menu''.
 
 top-level ``File'' menu.  @code{("Menu" "Foo" "Item")} means the menu
 item called ``Item'' under the ``Foo'' submenu of ``Menu''.
 
-@defun add-submenu menu-path submenu &optional before
+@defun add-submenu menu-path submenu &optional before in-menu
 This function adds a menu to the menubar or one of its submenus.  If the
 named menu exists already, it is changed.
 
 This function adds a menu to the menubar or one of its submenus.  If the
 named menu exists already, it is changed.
 
@@ -379,9 +379,12 @@ to the menubar itself.
 @var{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.
 @var{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.
+
+If @var{in-menu} is present use that instead of @code{current-menubar}
+as the menu to change.
 @end defun
 
 @end defun
 
-@defun add-menu-button menu-path menu-leaf &optional before
+@defun add-menu-button menu-path menu-leaf &optional before in-menu
 This function adds a menu item to some menu, creating the menu first if
 necessary.  If the named item exists already, it is changed.
 
 This function adds a menu item to some menu, creating the menu first if
 necessary.  If the named item exists already, it is changed.
 
@@ -393,11 +396,17 @@ be inserted.
 @var{before}, if provided, is the name of a menu 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.
 @var{before}, if provided, is the name of a menu 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.
+
+If @var{in-menu} is present use that instead of @code{current-menubar}
+as the menu to change.
 @end defun
 
 @end defun
 
-@defun delete-menu-item menu-item-path
+@defun delete-menu-item menu-item-path &optional from-menu
 This function removes the menu item specified by @var{menu-item-path}
 from the menu hierarchy.
 This function removes the menu item specified by @var{menu-item-path}
 from the menu hierarchy.
+
+If @var{from-menu} is present use that instead of @code{current-menubar}
+as the menu to change.
 @end defun
 
 @defun enable-menu-item menu-item-path
 @end defun
 
 @defun enable-menu-item menu-item-path
@@ -526,10 +535,10 @@ more information.
 @section Pop-Up Menus
 @cindex pop-up menu
 
 @section Pop-Up Menus
 @cindex pop-up menu
 
-@defun popup-menu menu-desc
-This function pops up a menu specified by @var{menu-desc}, which is a
-menu description (@pxref{Menu Format}).  The menu is displayed at the
-current mouse position.
+@defun popup-menu menu-description &optional event
+This function pops up a menu specified by @var{menu-description}, which
+is a menu description (@pxref{Menu Format}).  The menu is displayed at
+the current mouse position.
 @end defun
 
 @defun popup-menu-up-p
 @end defun
 
 @defun popup-menu-up-p
@@ -579,14 +588,15 @@ run.
 The following convenience functions are provided for displaying
 pop-up menus.
 
 The following convenience functions are provided for displaying
 pop-up menus.
 
-@defun popup-buffer-menu event
+@deffn Command popup-buffer-menu event
 This function pops up a copy of the @samp{Buffers} menu (from the menubar)
 This function pops up a copy of the @samp{Buffers} menu (from the menubar)
-where the mouse is clicked.
-@end defun
+where the mouse is clicked.  It should be bound to a mouse button event.
+@end deffn
 
 
-@defun popup-menubar-menu event
+@deffn Command popup-menubar-menu event
 This function pops up a copy of menu that also appears in the menubar.
 This function pops up a copy of menu that also appears in the menubar.
-@end defun
+It should be bound to a mouse button event.
+@end deffn
 
 @node Menu Accelerators
 @section Menu Accelerators
 
 @node Menu Accelerators
 @section Menu Accelerators
@@ -600,10 +610,10 @@ submenu of another menu.  An accelerator key for a menu item is used to
 activate that item.
 
 @menu
 activate that item.
 
 @menu
-* Creating Menu Accelerators:: How to add accelerator keys to a menu.
-* Keyboard Menu Traversal::    How to use and modify the keys which are used
-                               to traverse the menu structure.
-* Menu Accelerator Functions:: Functions for working with menu accelerators.
+* Creating Menu Accelerators::  How to add accelerator keys to a menu.
+* Keyboard Menu Traversal::     How to use and modify the keys which are used
+                                to traverse the menu structure.
+* Menu Accelerator Functions::  Functions for working with menu accelerators.
 @end menu
 
 @node Creating Menu Accelerators
 @end menu
 
 @node Creating Menu Accelerators
@@ -620,9 +630,9 @@ For example, the command
 
 @example
 (add-submenu nil '("%_Test"
 
 @example
 (add-submenu nil '("%_Test"
-                  ["One" (insert "1") :accelerator ?1 :active t]
-                  ["%_Two" (insert "2")]
-                  ["%_3" (insert "3")]))
+                   ["One" (insert "1") :accelerator ?1 :active t]
+                   ["%_Two" (insert "2")]
+                   ["%_3" (insert "3")]))
 @end example
 
 will add a new menu to the top level menubar.  The new menu can be reached
 @end example
 
 will add a new menu to the top level menubar.  The new menu can be reached
@@ -651,10 +661,10 @@ for more information about how to modify the menu traversal keys.
 @node Menu Accelerator Functions
 @subsection Menu Accelerator Functions
 
 @node Menu Accelerator Functions
 @subsection Menu Accelerator Functions
 
-@defun accelerate-menu
+@deffn Command accelerate-menu
 Make the menubar immediately active and place the cursor on the left most entry
 in the top level menu.  Menu items can be selected as usual.
 Make the menubar immediately active and place the cursor on the left most entry
 in the top level menu.  Menu items can be selected as usual.
-@end defun
+@end deffn
 
 @defvar menu-accelerator-enabled
 Whether menu accelerator keys can cause the menubar to become active.
 
 @defvar menu-accelerator-enabled
 Whether menu accelerator keys can cause the menubar to become active.
@@ -667,14 +677,14 @@ accelerator keys can be used regardless of the value of this variable.
 precedence over bindings in the current keymap(s).  @code{menu-fallback} means
 that bindings in the current keymap take precedence over menu accelerator keys.
 Thus a top level menu with an accelerator of "T" would be activated on a
 precedence over bindings in the current keymap(s).  @code{menu-fallback} means
 that bindings in the current keymap take precedence over menu accelerator keys.
 Thus a top level menu with an accelerator of "T" would be activated on a
-keypress of Meta-t if @var{menu-accelerator-enabled} is @code{menu-force}.
-However, if @var{menu-accelerator-enabled} is @code{menu-fallback}, then
+keypress of Meta-t if @code{menu-accelerator-enabled} is @code{menu-force}.
+However, if @code{menu-accelerator-enabled} is @code{menu-fallback}, then
 Meta-t will not activate the menubar and will instead run the function
 transpose-words, to which it is normally bound.
 
 The default value is @code{nil}.
 
 Meta-t will not activate the menubar and will instead run the function
 transpose-words, to which it is normally bound.
 
 The default value is @code{nil}.
 
-See also @var{menu-accelerator-modifiers} and @var{menu-accelerator-prefix}.
+See also @code{menu-accelerator-modifiers} and @code{menu-accelerator-prefix}.
 @end defvar
 
 @defvar menu-accelerator-map
 @end defvar
 
 @defvar menu-accelerator-map
@@ -688,12 +698,12 @@ accelerator in order for the top level menu to be activated in response to
 a keystroke.  The default value of @code{(meta)} mirrors the usage of the alt key
 as a menu accelerator in popular PC operating systems.
 
 a keystroke.  The default value of @code{(meta)} mirrors the usage of the alt key
 as a menu accelerator in popular PC operating systems.
 
-The modifier keys in @var{menu-accelerator-modifiers} must match exactly the
+The modifier keys in @code{menu-accelerator-modifiers} must match exactly the
 modifiers present in the keypress.  The only exception is that the shift
 modifiers present in the keypress.  The only exception is that the shift
-modifier is accepted in conjunction with alphabetic keys even if it is not
-a menu accelerator modifier.
+modifier is accepted in conjunction with alphabetic keys even if it is not a
+menu accelerator modifier.
 
 
-See also @var{menu-accelerator-enabled} and @var{menu-accelerator-prefix}.
+See also @code{menu-accelerator-enabled} and @code{menu-accelerator-prefix}.
 @end defvar
 
 @defvar menu-accelerator-prefix
 @end defvar
 
 @defvar menu-accelerator-prefix
@@ -708,9 +718,9 @@ The default value is @code{nil}.
 (setq menu-accelerator-modifiers '(meta control))
 (setq menu-accelerator-enabled 'menu-force)
 (add-submenu nil '("%_Test"
 (setq menu-accelerator-modifiers '(meta control))
 (setq menu-accelerator-enabled 'menu-force)
 (add-submenu nil '("%_Test"
-                  ["One" (insert "1") :accelerator ?1 :active t]
-                  ["%_Two" (insert "2")]
-                  ["%_3" (insert "3")]))
+                   ["One" (insert "1") :accelerator ?1 :active t]
+                   ["%_Two" (insert "2")]
+                   ["%_3" (insert "3")]))
 @end example
 
 will add the menu "Test" to the top level menubar.  Pressing C-x followed by
 @end example
 
 will add the menu "Test" to the top level menubar.  Pressing C-x followed by