diff options
| author | Chong Yidong | 2010-04-25 17:50:34 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-04-25 17:50:34 -0400 |
| commit | c7c322792abbc4c2a15d91799002a27084bf1df5 (patch) | |
| tree | a11d09d1cc899f752014896724983b3f8780177c | |
| parent | eb5ed549f4aa1fba7869ebb2d62cc974a4a1263a (diff) | |
| download | emacs-c7c322792abbc4c2a15d91799002a27084bf1df5.tar.gz emacs-c7c322792abbc4c2a15d91799002a27084bf1df5.zip | |
* keymaps.texi (Menu Bar): Document :advertised-binding property.
| -rw-r--r-- | doc/lispref/ChangeLog | 2 | ||||
| -rw-r--r-- | doc/lispref/keymaps.texi | 38 |
2 files changed, 28 insertions, 12 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index c2fd0a5e77e..e3028f26c07 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2010-04-25 Chong Yidong <cyd@stupidchicken.com> | 1 | 2010-04-25 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * keymaps.texi (Menu Bar): Document :advertised-binding property. | ||
| 4 | |||
| 3 | * functions.texi (Obsolete Functions): Document | 5 | * functions.texi (Obsolete Functions): Document |
| 4 | set-advertised-calling-convention. | 6 | set-advertised-calling-convention. |
| 5 | 7 | ||
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index d903d9c5aa6..d886b990dd8 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi | |||
| @@ -2470,9 +2470,13 @@ can do it this way: | |||
| 2470 | @cindex menu bar | 2470 | @cindex menu bar |
| 2471 | 2471 | ||
| 2472 | Most window systems allow each frame to have a @dfn{menu bar}---a | 2472 | Most window systems allow each frame to have a @dfn{menu bar}---a |
| 2473 | permanently displayed menu stretching horizontally across the top of the | 2473 | permanently displayed menu stretching horizontally across the top of |
| 2474 | frame. The items of the menu bar are the subcommands of the fake | 2474 | the frame. (In order for a frame to display a menu bar, its |
| 2475 | ``function key'' @code{menu-bar}, as defined in the active keymaps. | 2475 | @code{menu-bar-lines} parameter must be greater than zero. |
| 2476 | @xref{Layout Parameters}.) | ||
| 2477 | |||
| 2478 | The items of the menu bar are the subcommands of the fake ``function | ||
| 2479 | key'' @code{menu-bar}, as defined in the active keymaps. | ||
| 2476 | 2480 | ||
| 2477 | To add an item to the menu bar, invent a fake ``function key'' of your | 2481 | To add an item to the menu bar, invent a fake ``function key'' of your |
| 2478 | own (let's call it @var{key}), and make a binding for the key sequence | 2482 | own (let's call it @var{key}), and make a binding for the key sequence |
| @@ -2490,13 +2494,6 @@ determining the menu bar contents. That is, the menu bar is computed | |||
| 2490 | from the keymaps that would be active if @code{overriding-local-map} | 2494 | from the keymaps that would be active if @code{overriding-local-map} |
| 2491 | were @code{nil}. @xref{Active Keymaps}. | 2495 | were @code{nil}. @xref{Active Keymaps}. |
| 2492 | 2496 | ||
| 2493 | In order for a frame to display a menu bar, its @code{menu-bar-lines} | ||
| 2494 | parameter must be greater than zero. Emacs uses just one line for the | ||
| 2495 | menu bar itself; if you specify more than one line, the other lines | ||
| 2496 | serve to separate the menu bar from the windows in the frame. We | ||
| 2497 | recommend 1 or 2 as the value of @code{menu-bar-lines}. @xref{Layout | ||
| 2498 | Parameters}. | ||
| 2499 | |||
| 2500 | Here's an example of setting up a menu bar item: | 2497 | Here's an example of setting up a menu bar item: |
| 2501 | 2498 | ||
| 2502 | @example | 2499 | @example |
| @@ -2535,8 +2532,8 @@ bar item: | |||
| 2535 | @end example | 2532 | @end example |
| 2536 | 2533 | ||
| 2537 | @noindent | 2534 | @noindent |
| 2538 | @code{edit} is the fake function key used by the global map for the | 2535 | Here, @code{edit} is the fake function key used by the global map for |
| 2539 | @samp{Edit} menu bar item. The main reason to suppress a global | 2536 | the @samp{Edit} menu bar item. The main reason to suppress a global |
| 2540 | menu bar item is to regain space for mode-specific items. | 2537 | menu bar item is to regain space for mode-specific items. |
| 2541 | 2538 | ||
| 2542 | @defvar menu-bar-final-items | 2539 | @defvar menu-bar-final-items |
| @@ -2557,6 +2554,23 @@ advise you to ensure that the functions it calls do not take much time | |||
| 2557 | in the usual case. | 2554 | in the usual case. |
| 2558 | @end defvar | 2555 | @end defvar |
| 2559 | 2556 | ||
| 2557 | Next to every menu bar item, Emacs displays a key binding that runs | ||
| 2558 | the same command (if such a key binding exists). This serves as a | ||
| 2559 | convenient hint for users who do not know the key binding. If a | ||
| 2560 | command has multiple bindings, Emacs normally displays the first one | ||
| 2561 | it finds. You can specify one particular key binding by assigning an | ||
| 2562 | @code{:advertised-binding} symbol property to the command. For | ||
| 2563 | instance, the following tells Emacs to show @kbd{C-/} for the | ||
| 2564 | @code{undo} menu item: | ||
| 2565 | |||
| 2566 | @smallexample | ||
| 2567 | (put 'undo :advertised-binding [?\C-/]) | ||
| 2568 | @end smallexample | ||
| 2569 | |||
| 2570 | @noindent | ||
| 2571 | If the @code{:advertised-binding} property specifies a key binding | ||
| 2572 | that the command does not actually have, it is ignored. | ||
| 2573 | |||
| 2560 | @node Tool Bar | 2574 | @node Tool Bar |
| 2561 | @subsection Tool bars | 2575 | @subsection Tool bars |
| 2562 | @cindex tool bar | 2576 | @cindex tool bar |