diff options
| author | Dave Love | 2000-09-04 14:00:05 +0000 |
|---|---|---|
| committer | Dave Love | 2000-09-04 14:00:05 +0000 |
| commit | b08d86c6ef96379a081411dba6400f2de0c7f2e9 (patch) | |
| tree | 7d33856cc48280a7f572b55e5910066b4da8c397 | |
| parent | e3b9fc9196ffcde45fed8d4c4a66d5b95fe78f7e (diff) | |
| download | emacs-b08d86c6ef96379a081411dba6400f2de0c7f2e9.tar.gz emacs-b08d86c6ef96379a081411dba6400f2de0c7f2e9.zip | |
help-echo and menu prompts stuff
| -rw-r--r-- | lispref/keymaps.texi | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi index 68749792c49..0498dd12fdd 100644 --- a/lispref/keymaps.texi +++ b/lispref/keymaps.texi | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | @c -*-texinfo-*- | 1 | @c -*-texinfo-*- |
| 2 | @c This is part of the GNU Emacs Lisp Reference Manual. | 2 | @c This is part of the GNU Emacs Lisp Reference Manual. |
| 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999 | 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000 |
| 4 | @c Free Software Foundation, Inc. | 4 | @c Free Software Foundation, Inc. |
| 5 | @c See the file elisp.texi for copying conditions. | 5 | @c See the file elisp.texi for copying conditions. |
| 6 | @setfilename ../info/keymaps | 6 | @setfilename ../info/keymaps |
| @@ -228,7 +228,7 @@ to @code{nil}, and does not bind any other kind of event. | |||
| 228 | @end example | 228 | @end example |
| 229 | 229 | ||
| 230 | If you specify @var{prompt}, that becomes the overall prompt string for | 230 | If you specify @var{prompt}, that becomes the overall prompt string for |
| 231 | the keymap. The prompt string is useful for menu keymaps | 231 | the keymap. The prompt string should be provided for menu keymaps |
| 232 | (@pxref{Defining Menus}). | 232 | (@pxref{Defining Menus}). |
| 233 | @end defun | 233 | @end defun |
| 234 | 234 | ||
| @@ -474,7 +474,7 @@ its value. But if @var{mapvar} is non-@code{nil}, it sets @var{mapvar} | |||
| 474 | as a variable instead. | 474 | as a variable instead. |
| 475 | 475 | ||
| 476 | If @var{prompt} is non-@code{nil}, that becomes the overall prompt | 476 | If @var{prompt} is non-@code{nil}, that becomes the overall prompt |
| 477 | string for the keymap. The prompt string is useful for menu keymaps | 477 | string for the keymap. The prompt string should be given for menu keymaps |
| 478 | (@pxref{Defining Menus}). | 478 | (@pxref{Defining Menus}). |
| 479 | @end defun | 479 | @end defun |
| 480 | 480 | ||
| @@ -1527,13 +1527,15 @@ A keymap is suitable for menu use if it has an @dfn{overall prompt | |||
| 1527 | string}, which is a string that appears as an element of the keymap. | 1527 | string}, which is a string that appears as an element of the keymap. |
| 1528 | (@xref{Format of Keymaps}.) The string should describe the purpose of | 1528 | (@xref{Format of Keymaps}.) The string should describe the purpose of |
| 1529 | the menu's commands. Emacs displays the overall prompt string as the | 1529 | the menu's commands. Emacs displays the overall prompt string as the |
| 1530 | menu title in some cases, depending on which toolkit is used for | 1530 | menu title in some cases, depending on the toolkit (if any) used for |
| 1531 | displaying menus. Keyboard menus also display the overall prompt | 1531 | displaying menus.@footnote{It is required for menus which do not use a |
| 1532 | string. | 1532 | toolkit, e.g.@: under MS-DOS.} Keyboard menus also display the overall |
| 1533 | prompt string. | ||
| 1533 | 1534 | ||
| 1534 | The easiest way to construct a keymap with a prompt string is to specify | 1535 | The easiest way to construct a keymap with a prompt string is to specify |
| 1535 | the string as an argument when you call @code{make-keymap} or | 1536 | the string as an argument when you call @code{make-keymap}, |
| 1536 | @code{make-sparse-keymap} (@pxref{Creating Keymaps}). | 1537 | @code{make-sparse-keymap} or @code{define-prefix-command} |
| 1538 | (@pxref{Creating Keymaps}). | ||
| 1537 | 1539 | ||
| 1538 | The order of items in the menu is the same as the order of bindings in | 1540 | The order of items in the menu is the same as the order of bindings in |
| 1539 | the keymap. Since @code{define-key} puts new bindings at the front, you | 1541 | the keymap. Since @code{define-key} puts new bindings at the front, you |
| @@ -1570,11 +1572,12 @@ describe the action of the command it corresponds to. | |||
| 1570 | You can also supply a second string, called the help string, as follows: | 1572 | You can also supply a second string, called the help string, as follows: |
| 1571 | 1573 | ||
| 1572 | @example | 1574 | @example |
| 1573 | (@var{item-string} @var{help-string} . @var{real-binding}) | 1575 | (@var{item-string} @var{help} . @var{real-binding}) |
| 1574 | @end example | 1576 | @end example |
| 1575 | 1577 | ||
| 1576 | @var{help-string} specifies a ``help-echo'' string to display while the | 1578 | @var{help} specifies a ``help-echo'' string to display while the mouse |
| 1577 | mouse is on that item. | 1579 | is on that item in the same way as @code{help-echo} text properties |
| 1580 | (@pxref{Help display}). | ||
| 1578 | 1581 | ||
| 1579 | As far as @code{define-key} is concerned, @var{item-string} and | 1582 | As far as @code{define-key} is concerned, @var{item-string} and |
| 1580 | @var{help-string} are part of the event's binding. However, | 1583 | @var{help-string} are part of the event's binding. However, |
| @@ -1657,8 +1660,11 @@ does not appear, then the menu is displayed as if this item were | |||
| 1657 | not defined at all. | 1660 | not defined at all. |
| 1658 | 1661 | ||
| 1659 | @item :help @var{help} | 1662 | @item :help @var{help} |
| 1660 | The value of this property, @var{help}, is the ``help-echo'' string to | 1663 | The value of this property, @var{help}, specifies a ``help-echo'' string |
| 1661 | display while the mouse is on that item. | 1664 | to display while the mouse is on that item. This is displayed in the |
| 1665 | same way as @code{help-echo} text properties (@pxref{Help display}). | ||
| 1666 | Note that this must be a constant string, unlike the @code{help-echo} | ||
| 1667 | property for text and overlays. | ||
| 1662 | 1668 | ||
| 1663 | @item :button (@var{type} . @var{selected}) | 1669 | @item :button (@var{type} . @var{selected}) |
| 1664 | This property provides a way to define radio buttons and toggle buttons. | 1670 | This property provides a way to define radio buttons and toggle buttons. |
| @@ -2124,8 +2130,9 @@ tool bar bindings and have their normal meanings. The @var{real-binding} | |||
| 2124 | in the item must be a command, not a keymap; in other words, it does not | 2130 | in the item must be a command, not a keymap; in other words, it does not |
| 2125 | work to define a tool bar icon as a prefix key. | 2131 | work to define a tool bar icon as a prefix key. |
| 2126 | 2132 | ||
| 2127 | The @code{:help} property is meaningful, and specifies a ``help-echo'' | 2133 | The @code{:help} property specifies a ``help-echo'' string to display |
| 2128 | string to display while the mouse is on that item. | 2134 | while the mouse is on that item. This is displayed in the same way as |
| 2135 | @code{help-echo} text properties (@pxref{Help display}). | ||
| 2129 | 2136 | ||
| 2130 | In addition, you should use the @code{:image} property; | 2137 | In addition, you should use the @code{:image} property; |
| 2131 | this is how you specify the image to display in the tool bar: | 2138 | this is how you specify the image to display in the tool bar: |