www.delorie.com/gnu/docs/elisp-manual-21/elisp_336.html   search  
 
Buy the book!


GNU Emacs Lisp Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

22.12.1 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. (See section 22.2 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.(6) 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 (see section 22.3 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 (see section 22.12.7 Modifying Menus).

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


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003