aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-12-18 10:22:02 +0000
committerGerd Moellmann2000-12-18 10:22:02 +0000
commit5f1f59555a8708664dea8aeb2f8cda3283a2e37a (patch)
tree31272aab5ab2bc8480a70731c2d69c4680a103cb
parent3f5dc0b0306bb585e9c3381d8a9f16a62c36d590 (diff)
downloademacs-5f1f59555a8708664dea8aeb2f8cda3283a2e37a.tar.gz
emacs-5f1f59555a8708664dea8aeb2f8cda3283a2e37a.zip
*** empty log message ***
-rw-r--r--lispref/keymaps.texi35
1 files changed, 22 insertions, 13 deletions
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index efe89b56f27..ecd24704df3 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -151,12 +151,16 @@ use the keymap as a menu. @xref{Defining Menus}.
151 151
152@cindex meta characters lookup 152@cindex meta characters lookup
153 Keymaps do not directly record bindings for the meta characters. 153 Keymaps do not directly record bindings for the meta characters.
154Instead, meta characters are regarded for 154Instead, meta characters are regarded for purposes of key lookup as
155purposes of key lookup as sequences of two characters, the first of 155sequences of two characters, the first of which is @key{ESC} (or
156which is @key{ESC} (or whatever is currently the value of 156whatever is currently the value of @code{meta-prefix-char}). Thus, the
157@code{meta-prefix-char}). Thus, the key @kbd{M-a} is really represented 157key @kbd{M-a} is internally represented as @kbd{@key{ESC} a}, and its
158as @kbd{@key{ESC} a}, and its global binding is found at the slot for 158global binding is found at the slot for @kbd{a} in @code{esc-map}
159@kbd{a} in @code{esc-map} (@pxref{Prefix Keys}). 159(@pxref{Prefix Keys}).
160
161 This conversion applies only to characters, not to function keys or
162other input events; thus, @kbd{M-@key{end}} has nothing to do with
163@kbd{@key{ESC} @key{end}}.
160 164
161 Here as an example is the local keymap for Lisp mode, a sparse 165 Here as an example is the local keymap for Lisp mode, a sparse
162keymap. It defines bindings for @key{DEL} and @key{TAB}, plus @kbd{C-c 166keymap. It defines bindings for @key{DEL} and @key{TAB}, plus @kbd{C-c
@@ -864,9 +868,9 @@ the specific sequence @var{key}, ignoring default bindings except when
864you explicitly ask about them. (To do this, supply @code{t} as an 868you explicitly ask about them. (To do this, supply @code{t} as an
865element of @var{key}; see @ref{Format of Keymaps}.) 869element of @var{key}; see @ref{Format of Keymaps}.)
866 870
867If @var{key} contains a meta character, that character is implicitly 871If @var{key} contains a meta character (not a function key), that
868replaced by a two-character sequence: the value of 872character is implicitly replaced by a two-character sequence: the value
869@code{meta-prefix-char}, followed by the corresponding non-meta 873of @code{meta-prefix-char}, followed by the corresponding non-meta
870character. Thus, the first example below is handled by conversion into 874character. Thus, the first example below is handled by conversion into
871the second example. 875the second example.
872 876
@@ -955,12 +959,13 @@ looked up in a keymap. For useful results, the value should be a prefix
955event (@pxref{Prefix Keys}). The default value is 27, which is the 959event (@pxref{Prefix Keys}). The default value is 27, which is the
956@sc{ascii} code for @key{ESC}. 960@sc{ascii} code for @key{ESC}.
957 961
958As long as the value of @code{meta-prefix-char} remains 27, key 962As long as the value of @code{meta-prefix-char} remains 27, key lookup
959lookup translates @kbd{M-b} into @kbd{@key{ESC} b}, which is normally 963translates @kbd{M-b} into @kbd{@key{ESC} b}, which is normally defined
960defined as the @code{backward-word} command. However, if you set 964as the @code{backward-word} command. However, if you were to set
961@code{meta-prefix-char} to 24, the code for @kbd{C-x}, then Emacs will 965@code{meta-prefix-char} to 24, the code for @kbd{C-x}, then Emacs will
962translate @kbd{M-b} into @kbd{C-x b}, whose standard binding is the 966translate @kbd{M-b} into @kbd{C-x b}, whose standard binding is the
963@code{switch-to-buffer} command. Here is an illustration: 967@code{switch-to-buffer} command. (Don't actually do this!) Here is an
968illustration of what would happen:
964 969
965@smallexample 970@smallexample
966@group 971@group
@@ -988,6 +993,10 @@ meta-prefix-char ; @r{The default value.}
988 @result{} 27 ; @r{Restore the default value!} 993 @result{} 27 ; @r{Restore the default value!}
989@end group 994@end group
990@end smallexample 995@end smallexample
996
997This translation of one event into two happens only for characters, not
998for other kinds of input events. Thus, @kbd{M-@key{F1}}, a function
999key, is not converted into @kbd{@key{ESC} @key{F1}}.
991@end defvar 1000@end defvar
992 1001
993@node Changing Key Bindings 1002@node Changing Key Bindings