aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-10-11 09:22:44 +0000
committerRichard M. Stallman1994-10-11 09:22:44 +0000
commit00a78037a87c5c5a6c25a3a1509d9361524d829f (patch)
treee7372038b297bee1dc3a1479ed876bf20afc240d /src
parent2df1ee235231d56a60be2c2989969c08f58e8bc5 (diff)
downloademacs-00a78037a87c5c5a6c25a3a1509d9361524d829f.tar.gz
emacs-00a78037a87c5c5a6c25a3a1509d9361524d829f.zip
(read_key_sequence): The output of function-key-map
goes to key-translation-map, but not vice versa. Don't exit if either of them is a possibility.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 7ddb01741aa..ddaf4752382 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4443,6 +4443,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4443 /* Nonzero if we seem to have got the beginning of a binding 4443 /* Nonzero if we seem to have got the beginning of a binding
4444 in function_key_map. */ 4444 in function_key_map. */
4445 int function_key_possible = 0; 4445 int function_key_possible = 0;
4446 int key_translation_possible = 0;
4446 4447
4447 int junk; 4448 int junk;
4448 4449
@@ -4494,6 +4495,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4494 4495
4495 starting_buffer = current_buffer; 4496 starting_buffer = current_buffer;
4496 function_key_possible = 0; 4497 function_key_possible = 0;
4498 key_translation_possible = 0;
4497 4499
4498 /* Build our list of keymaps. 4500 /* Build our list of keymaps.
4499 If we recognize a function key and replace its escape sequence in 4501 If we recognize a function key and replace its escape sequence in
@@ -4555,10 +4557,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4555 && fkey_start < t 4557 && fkey_start < t
4556 /* mock input is never part of a function key's sequence. */ 4558 /* mock input is never part of a function key's sequence. */
4557 && mock_input <= fkey_start) 4559 && mock_input <= fkey_start)
4558 || (first_binding >= nmaps 4560 || (keytran_start < t && key_translation_possible)
4559 && keytran_start < t
4560 /* mock input is never part of a function key's sequence. */
4561 && mock_input <= keytran_start)
4562 /* Don't return in the middle of a possible function key sequence, 4561 /* Don't return in the middle of a possible function key sequence,
4563 if the only bindings we found were via case conversion. 4562 if the only bindings we found were via case conversion.
4564 Thus, if ESC O a has a function-key-map translation 4563 Thus, if ESC O a has a function-key-map translation
@@ -5014,6 +5013,10 @@ read_key_sequence (keybuf, bufsize, prompt)
5014 fkey_start = fkey_end = t; 5013 fkey_start = fkey_end = t;
5015 fkey_map = Vfunction_key_map; 5014 fkey_map = Vfunction_key_map;
5016 5015
5016 /* Do pass the results through key-translation-map. */
5017 keytran_start = keytran_end = 0;
5018 keytran_map = Vkey_translation_map;
5019
5017 goto replay_sequence; 5020 goto replay_sequence;
5018 } 5021 }
5019 5022
@@ -5078,6 +5081,8 @@ read_key_sequence (keybuf, bufsize, prompt)
5078 error ("Function in key-translation-map returns invalid key sequence"); 5081 error ("Function in key-translation-map returns invalid key sequence");
5079 } 5082 }
5080 5083
5084 key_translation_possible = ! NILP (keytran_next);
5085
5081 /* If keybuf[keytran_start..keytran_end] is bound in the 5086 /* If keybuf[keytran_start..keytran_end] is bound in the
5082 key translation map and it's a suffix of the current 5087 key translation map and it's a suffix of the current
5083 sequence (i.e. keytran_end == t), replace it with 5088 sequence (i.e. keytran_end == t), replace it with
@@ -5108,6 +5113,11 @@ read_key_sequence (keybuf, bufsize, prompt)
5108 keytran_start = keytran_end = t; 5113 keytran_start = keytran_end = t;
5109 keytran_map = Vkey_translation_map; 5114 keytran_map = Vkey_translation_map;
5110 5115
5116 /* Don't pass the results of key-translation-map
5117 through function-key-map. */
5118 fkey_start = fkey_end = t;
5119 fkey_map = Vkey_translation_map;
5120
5111 goto replay_sequence; 5121 goto replay_sequence;
5112 } 5122 }
5113 5123
@@ -5119,6 +5129,7 @@ read_key_sequence (keybuf, bufsize, prompt)
5119 { 5129 {
5120 keytran_end = ++keytran_start; 5130 keytran_end = ++keytran_start;
5121 keytran_map = Vkey_translation_map; 5131 keytran_map = Vkey_translation_map;
5132 key_translation_possible = 0;
5122 } 5133 }
5123 } 5134 }
5124 } 5135 }
@@ -5128,6 +5139,7 @@ read_key_sequence (keybuf, bufsize, prompt)
5128 and is an upper case letter 5139 and is an upper case letter
5129 use the corresponding lower-case letter instead. */ 5140 use the corresponding lower-case letter instead. */
5130 if (first_binding == nmaps && ! function_key_possible 5141 if (first_binding == nmaps && ! function_key_possible
5142 && ! key_translation_possible
5131 && INTEGERP (key) 5143 && INTEGERP (key)
5132 && ((((XINT (key) & 0x3ffff) 5144 && ((((XINT (key) & 0x3ffff)
5133 < XSTRING (current_buffer->downcase_table)->size) 5145 < XSTRING (current_buffer->downcase_table)->size)