diff options
| author | Richard M. Stallman | 2006-09-15 18:29:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-09-15 18:29:06 +0000 |
| commit | 74f526f33bfb0deeb9036a7082177f94f4201c20 (patch) | |
| tree | 1d1cff7bcb814711bd1e9e2735aefb875a5e55c2 | |
| parent | 45a2056c56c77c3e3fedd045d383d5734a4f410c (diff) | |
| download | emacs-74f526f33bfb0deeb9036a7082177f94f4201c20.tar.gz emacs-74f526f33bfb0deeb9036a7082177f94f4201c20.zip | |
(Remapping Commands, Searching Keymaps)
(Active Keymaps): Clean up previous change.
| -rw-r--r-- | lispref/ChangeLog | 9 | ||||
| -rw-r--r-- | lispref/keymaps.texi | 61 |
2 files changed, 37 insertions, 33 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index e1a14e55526..9251e10c8de 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2006-09-15 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * keymaps.texi (Remapping Commands, Searching Keymaps) | ||
| 4 | (Active Keymaps): Clean up previous change. | ||
| 5 | |||
| 1 | 2006-09-15 Jay Belanger <belanger@truman.edu> | 6 | 2006-09-15 Jay Belanger <belanger@truman.edu> |
| 2 | 7 | ||
| 3 | * gpl.texi: Replace "Library Public License" by "Lesser Public | 8 | * gpl.texi: Replace "Library Public License" by "Lesser Public |
| @@ -9,8 +14,8 @@ | |||
| 9 | `get-char-property' instead `get-text-property'. Explain how | 14 | `get-char-property' instead `get-text-property'. Explain how |
| 10 | mouse events change this. Explain the new optional argument of | 15 | mouse events change this. Explain the new optional argument of |
| 11 | `key-binding' and its mouse-dependent lookup. | 16 | `key-binding' and its mouse-dependent lookup. |
| 12 | (Searching Keymaps): Adapt description similarly. Explain the new | 17 | (Searching Keymaps): Adapt description similarly. |
| 13 | optional argument of `command-remapping'. | 18 | (Remapping Commands): Explain the new optional argument of `command-remapping'. |
| 14 | 19 | ||
| 15 | 2006-09-14 Richard Stallman <rms@gnu.org> | 20 | 2006-09-14 Richard Stallman <rms@gnu.org> |
| 16 | 21 | ||
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi index 309664c38dd..f9b0456c7da 100644 --- a/lispref/keymaps.texi +++ b/lispref/keymaps.texi | |||
| @@ -576,15 +576,12 @@ keymap, and the global keymap, in that order. Emacs searches for each | |||
| 576 | input key sequence in all these keymaps. @xref{Searching Keymaps}, | 576 | input key sequence in all these keymaps. @xref{Searching Keymaps}, |
| 577 | for more details of this procedure. | 577 | for more details of this procedure. |
| 578 | 578 | ||
| 579 | This process is somewhat modified for mouse events: the local modes and | 579 | When the key sequence starts with a mouse event (optionally preceded |
| 580 | keymaps of the buffer corresponding to the mouse click position are | 580 | by a symbolic prefix), the active keymaps are determined based on the |
| 581 | searched instead, text properties are taken from the mouse click | 581 | position in that event. If the event happened on a string embedded |
| 582 | position in the buffer rather than point, and if the click happens on a | 582 | with a @code{display}, @code{before-string}, or @code{after-string} |
| 583 | string embedded with a @code{display}, @code{before-string}, or | 583 | property (@pxref{Special Properties}), the non-@code{nil} map |
| 584 | @code{after-string} text property (@pxref{Special Properties}) or | 584 | properties of the string override those of the buffer. |
| 585 | overlay property (@pxref{Overlay Properties}), any non-@code{nil} maps | ||
| 586 | specified with text properties of this string are searched instead of | ||
| 587 | those of the buffer. | ||
| 588 | 585 | ||
| 589 | The @dfn{global keymap} holds the bindings of keys that are defined | 586 | The @dfn{global keymap} holds the bindings of keys that are defined |
| 590 | regardless of the current buffer, such as @kbd{C-f}. The variable | 587 | regardless of the current buffer, such as @kbd{C-f}. The variable |
| @@ -643,12 +640,10 @@ non-@code{nil} then it pays attention to them. | |||
| 643 | @end defun | 640 | @end defun |
| 644 | 641 | ||
| 645 | @defun key-binding key &optional accept-defaults no-remap position | 642 | @defun key-binding key &optional accept-defaults no-remap position |
| 646 | This function returns the binding for @var{key} according to the current | 643 | This function returns the binding for @var{key} according to the |
| 647 | active keymaps. The result is @code{nil} if @var{key} is undefined in | 644 | current active keymaps. The result is @code{nil} if @var{key} is |
| 648 | the keymaps. If @var{key} is a key sequence started with the mouse, the | 645 | undefined in the keymaps. |
| 649 | consulted maps will be changed accordingly. | ||
| 650 | 646 | ||
| 651 | @c Emacs 19 feature | ||
| 652 | The argument @var{accept-defaults} controls checking for default | 647 | The argument @var{accept-defaults} controls checking for default |
| 653 | bindings, as in @code{lookup-key} (above). | 648 | bindings, as in @code{lookup-key} (above). |
| 654 | 649 | ||
| @@ -658,10 +653,13 @@ returns the remapped command that will actually be executed. However, | |||
| 658 | if @var{no-remap} is non-@code{nil}, @code{key-binding} ignores | 653 | if @var{no-remap} is non-@code{nil}, @code{key-binding} ignores |
| 659 | remappings and returns the binding directly specified for @var{key}. | 654 | remappings and returns the binding directly specified for @var{key}. |
| 660 | 655 | ||
| 661 | If @var{position} is non-@code{nil}, it specifies either a buffer | 656 | If @var{key} starts with a mouse event (perhaps following a prefix |
| 662 | position or a position like those returned from @code{event-start}. In | 657 | event), the maps to be consulted are determined based on the event's |
| 663 | this case, @var{position} instead of @var{key} determines the | 658 | position. Otherwise, they are determined based on the value of point. |
| 664 | click-specific maps. | 659 | However, you can override either of them by specifying @var{position}. |
| 660 | If @var{position} is non-@code{nil}, it should be either a buffer | ||
| 661 | position or an event position like the value of @code{event-start}. | ||
| 662 | Then the maps consulted are determined based on @var{position}. | ||
| 665 | 663 | ||
| 666 | An error is signaled if @var{key} is not a string or a vector. | 664 | An error is signaled if @var{key} is not a string or a vector. |
| 667 | 665 | ||
| @@ -697,13 +695,14 @@ them: | |||
| 697 | @end lisp | 695 | @end lisp |
| 698 | 696 | ||
| 699 | @noindent | 697 | @noindent |
| 700 | The @var{find-in} and @var{find-in-any} are pseudo functions that search | 698 | The @var{find-in} and @var{find-in-any} are pseudo functions that |
| 701 | in one keymap and in an alist of keymaps, respectively. (Searching a | 699 | search in one keymap and in an alist of keymaps, respectively. |
| 702 | single keymap for a binding is called @dfn{key lookup}; see @ref{Key | 700 | (Searching a single keymap for a binding is called @dfn{key lookup}; |
| 703 | Lookup}.) Mouse events on strings will use text properties from the | 701 | see @ref{Key Lookup}.) If the key sequence starts with a mouse event, |
| 704 | string if non-@code{nil} instead of the buffer. Also, point and current | 702 | or a symbolic prefix event followed by a mouse event, that event's |
| 705 | buffer for mouse-based events are switched to correspond to the position | 703 | position is used instead of point and the current buffer. Mouse |
| 706 | of the event start while performing the lookup. | 704 | events on an embedded string use text properties from that string |
| 705 | instead of the buffer. | ||
| 707 | 706 | ||
| 708 | @enumerate | 707 | @enumerate |
| 709 | @item | 708 | @item |
| @@ -1466,12 +1465,12 @@ if an ordinary binding specifies @code{my-kill-line}, this keymap will | |||
| 1466 | remap it to @code{my-other-kill-line}. | 1465 | remap it to @code{my-other-kill-line}. |
| 1467 | 1466 | ||
| 1468 | @defun command-remapping command &optional position | 1467 | @defun command-remapping command &optional position |
| 1469 | This function returns the remapping for @var{command} (a symbol), given | 1468 | This function returns the remapping for @var{command} (a symbol), |
| 1470 | the current active keymaps. If @var{command} is not remapped (which is | 1469 | given the current active keymaps. If @var{command} is not remapped |
| 1471 | the usual situation), or not a symbol, the function returns @code{nil}. | 1470 | (which is the usual situation), or not a symbol, the function returns |
| 1472 | @code{position} can optionally specify a buffer position or a position | 1471 | @code{nil}. @code{position} can optionally specify a buffer position |
| 1473 | like those returned from @code{event-start}: in that case, the active | 1472 | or an event position to determine the keymaps to use, as in |
| 1474 | maps are changed like they are in @code{key-binding}. | 1473 | @code{key-binding}. |
| 1475 | @end defun | 1474 | @end defun |
| 1476 | 1475 | ||
| 1477 | @node Translation Keymaps | 1476 | @node Translation Keymaps |