GNU Info

Info Node: (elisp)Defining Menus

(elisp)Defining Menus


Next: Mouse Menus Up: Menu Keymaps
Enter node , (file) or (file)node

Defining Menus
--------------

   A keymap is suitable for menu use if it has an "overall prompt
string", which is a string that appears as an element of the keymap.
(Note: Format of Keymaps.)  The string should describe the purpose of
the menu's commands.  Emacs displays the overall prompt string as the
menu title in some cases, depending on the toolkit (if any) used for
displaying menus.(1)  Keyboard menus also display the overall prompt
string.

   The easiest way to construct a keymap with a prompt string is to
specify the string as an argument when you call `make-keymap',
`make-sparse-keymap' or `define-prefix-command' (Note: Creating
Keymaps).

   The order of items in the menu is the same as the order of bindings
in the keymap.  Since `define-key' puts new bindings at the front, you
should define the menu items starting at the bottom of the menu and
moving to the top, if you care about the order.  When you add an item to
an existing menu, you can specify its position in the menu using
`define-key-after' (Note: Modifying Menus).

Simple Menu Items
A simple kind of menu key binding,
limited in capabilities.
Extended Menu Items
More powerful menu item definitions
let you specify keywords to enable various features.
Menu Separators
Drawing a horizontal line through a menu.
Alias Menu Items
Using command aliases in menu items.
   ---------- Footnotes ----------

   (1) It is required for menus which do not use a toolkit, e.g. under
MS-DOS.


automatically generated by info2www version 1.2.2.9