diff options
| author | Gerd Moellmann | 2000-12-18 10:22:02 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-12-18 10:22:02 +0000 |
| commit | 5f1f59555a8708664dea8aeb2f8cda3283a2e37a (patch) | |
| tree | 31272aab5ab2bc8480a70731c2d69c4680a103cb | |
| parent | 3f5dc0b0306bb585e9c3381d8a9f16a62c36d590 (diff) | |
| download | emacs-5f1f59555a8708664dea8aeb2f8cda3283a2e37a.tar.gz emacs-5f1f59555a8708664dea8aeb2f8cda3283a2e37a.zip | |
*** empty log message ***
| -rw-r--r-- | lispref/keymaps.texi | 35 |
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. |
| 154 | Instead, meta characters are regarded for | 154 | Instead, meta characters are regarded for purposes of key lookup as |
| 155 | purposes of key lookup as sequences of two characters, the first of | 155 | sequences of two characters, the first of which is @key{ESC} (or |
| 156 | which is @key{ESC} (or whatever is currently the value of | 156 | whatever 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 | 157 | key @kbd{M-a} is internally represented as @kbd{@key{ESC} a}, and its |
| 158 | as @kbd{@key{ESC} a}, and its global binding is found at the slot for | 158 | global 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 | ||
| 162 | other 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 |
| 162 | keymap. It defines bindings for @key{DEL} and @key{TAB}, plus @kbd{C-c | 166 | keymap. 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 | |||
| 864 | you explicitly ask about them. (To do this, supply @code{t} as an | 868 | you explicitly ask about them. (To do this, supply @code{t} as an |
| 865 | element of @var{key}; see @ref{Format of Keymaps}.) | 869 | element of @var{key}; see @ref{Format of Keymaps}.) |
| 866 | 870 | ||
| 867 | If @var{key} contains a meta character, that character is implicitly | 871 | If @var{key} contains a meta character (not a function key), that |
| 868 | replaced by a two-character sequence: the value of | 872 | character is implicitly replaced by a two-character sequence: the value |
| 869 | @code{meta-prefix-char}, followed by the corresponding non-meta | 873 | of @code{meta-prefix-char}, followed by the corresponding non-meta |
| 870 | character. Thus, the first example below is handled by conversion into | 874 | character. Thus, the first example below is handled by conversion into |
| 871 | the second example. | 875 | the second example. |
| 872 | 876 | ||
| @@ -955,12 +959,13 @@ looked up in a keymap. For useful results, the value should be a prefix | |||
| 955 | event (@pxref{Prefix Keys}). The default value is 27, which is the | 959 | event (@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 | ||
| 958 | As long as the value of @code{meta-prefix-char} remains 27, key | 962 | As long as the value of @code{meta-prefix-char} remains 27, key lookup |
| 959 | lookup translates @kbd{M-b} into @kbd{@key{ESC} b}, which is normally | 963 | translates @kbd{M-b} into @kbd{@key{ESC} b}, which is normally defined |
| 960 | defined as the @code{backward-word} command. However, if you set | 964 | as 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 |
| 962 | translate @kbd{M-b} into @kbd{C-x b}, whose standard binding is the | 966 | translate @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 |
| 968 | illustration 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 | |||
| 997 | This translation of one event into two happens only for characters, not | ||
| 998 | for other kinds of input events. Thus, @kbd{M-@key{F1}}, a function | ||
| 999 | key, 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 |