aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-09-15 18:29:06 +0000
committerRichard M. Stallman2006-09-15 18:29:06 +0000
commit74f526f33bfb0deeb9036a7082177f94f4201c20 (patch)
tree1d1cff7bcb814711bd1e9e2735aefb875a5e55c2
parent45a2056c56c77c3e3fedd045d383d5734a4f410c (diff)
downloademacs-74f526f33bfb0deeb9036a7082177f94f4201c20.tar.gz
emacs-74f526f33bfb0deeb9036a7082177f94f4201c20.zip
(Remapping Commands, Searching Keymaps)
(Active Keymaps): Clean up previous change.
-rw-r--r--lispref/ChangeLog9
-rw-r--r--lispref/keymaps.texi61
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 @@
12006-09-15 Richard Stallman <rms@gnu.org>
2
3 * keymaps.texi (Remapping Commands, Searching Keymaps)
4 (Active Keymaps): Clean up previous change.
5
12006-09-15 Jay Belanger <belanger@truman.edu> 62006-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
152006-09-14 Richard Stallman <rms@gnu.org> 202006-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
576input key sequence in all these keymaps. @xref{Searching Keymaps}, 576input key sequence in all these keymaps. @xref{Searching Keymaps},
577for more details of this procedure. 577for more details of this procedure.
578 578
579This process is somewhat modified for mouse events: the local modes and 579 When the key sequence starts with a mouse event (optionally preceded
580keymaps of the buffer corresponding to the mouse click position are 580by a symbolic prefix), the active keymaps are determined based on the
581searched instead, text properties are taken from the mouse click 581position in that event. If the event happened on a string embedded
582position in the buffer rather than point, and if the click happens on a 582with a @code{display}, @code{before-string}, or @code{after-string}
583string embedded with a @code{display}, @code{before-string}, or 583property (@pxref{Special Properties}), the non-@code{nil} map
584@code{after-string} text property (@pxref{Special Properties}) or 584properties of the string override those of the buffer.
585overlay property (@pxref{Overlay Properties}), any non-@code{nil} maps
586specified with text properties of this string are searched instead of
587those 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
590regardless of the current buffer, such as @kbd{C-f}. The variable 587regardless 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
646This function returns the binding for @var{key} according to the current 643This function returns the binding for @var{key} according to the
647active keymaps. The result is @code{nil} if @var{key} is undefined in 644current active keymaps. The result is @code{nil} if @var{key} is
648the keymaps. If @var{key} is a key sequence started with the mouse, the 645undefined in the keymaps.
649consulted maps will be changed accordingly.
650 646
651@c Emacs 19 feature
652The argument @var{accept-defaults} controls checking for default 647The argument @var{accept-defaults} controls checking for default
653bindings, as in @code{lookup-key} (above). 648bindings, as in @code{lookup-key} (above).
654 649
@@ -658,10 +653,13 @@ returns the remapped command that will actually be executed. However,
658if @var{no-remap} is non-@code{nil}, @code{key-binding} ignores 653if @var{no-remap} is non-@code{nil}, @code{key-binding} ignores
659remappings and returns the binding directly specified for @var{key}. 654remappings and returns the binding directly specified for @var{key}.
660 655
661If @var{position} is non-@code{nil}, it specifies either a buffer 656If @var{key} starts with a mouse event (perhaps following a prefix
662position or a position like those returned from @code{event-start}. In 657event), the maps to be consulted are determined based on the event's
663this case, @var{position} instead of @var{key} determines the 658position. Otherwise, they are determined based on the value of point.
664click-specific maps. 659However, you can override either of them by specifying @var{position}.
660If @var{position} is non-@code{nil}, it should be either a buffer
661position or an event position like the value of @code{event-start}.
662Then the maps consulted are determined based on @var{position}.
665 663
666An error is signaled if @var{key} is not a string or a vector. 664An 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
700The @var{find-in} and @var{find-in-any} are pseudo functions that search 698The @var{find-in} and @var{find-in-any} are pseudo functions that
701in one keymap and in an alist of keymaps, respectively. (Searching a 699search in one keymap and in an alist of keymaps, respectively.
702single 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};
703Lookup}.) Mouse events on strings will use text properties from the 701see @ref{Key Lookup}.) If the key sequence starts with a mouse event,
704string if non-@code{nil} instead of the buffer. Also, point and current 702or a symbolic prefix event followed by a mouse event, that event's
705buffer for mouse-based events are switched to correspond to the position 703position is used instead of point and the current buffer. Mouse
706of the event start while performing the lookup. 704events on an embedded string use text properties from that string
705instead 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
1466remap it to @code{my-other-kill-line}. 1465remap it to @code{my-other-kill-line}.
1467 1466
1468@defun command-remapping command &optional position 1467@defun command-remapping command &optional position
1469This function returns the remapping for @var{command} (a symbol), given 1468This function returns the remapping for @var{command} (a symbol),
1470the current active keymaps. If @var{command} is not remapped (which is 1469given the current active keymaps. If @var{command} is not remapped
1471the 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
1473like those returned from @code{event-start}: in that case, the active 1472or an event position to determine the keymaps to use, as in
1474maps 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