comparison src/keyboard.c @ 85427:ca2b443907f8

(read_key_sequence): Undo a change introduced by multi-tty which caused key-translation-map to applied repeatedly (thus breaking double-mode).
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 18 Oct 2007 22:07:34 +0000
parents 0bc184c59770
children 5834796c60e5 1251cabc40b7
comparison
equal deleted inserted replaced
85426:78a8351088a9 85427:ca2b443907f8
9183 9183
9184 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); 9184 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
9185 orig_keymap = get_local_map (PT, current_buffer, Qkeymap); 9185 orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
9186 from_string = Qnil; 9186 from_string = Qnil;
9187 9187
9188 /* We jump here when the key sequence has been thoroughly changed, and 9188 /* The multi-tty merge moved the code below to right after
9189 we need to rescan it starting from the beginning. When we jump here, 9189 `replay_sequence' which caused alll these translation maps to be applied
9190 keybuf[0..mock_input] holds the sequence we should reread. */ 9190 repeatedly, even tho their doc says very clearly they are not applied to
9191 replay_sequence: 9191 their own output.
9192 9192 The reason for this move was: "We may switch keyboards between rescans,
9193 /* We may switch keyboards between rescans, so we need to 9193 so we need to reinitialize fkey and keytran before each replay".
9194 reinitialize fkey and keytran before each replay. */ 9194 This move was wrong (even if we switch keyboards, keybuf still holds the
9195 keys we've read already from the original keyboard and some of those keys
9196 may have already been translated). So there may still be a bug out there
9197 lurking. */
9195 indec.map = indec.parent = current_kboard->Vinput_decode_map; 9198 indec.map = indec.parent = current_kboard->Vinput_decode_map;
9196 fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; 9199 fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map;
9197 keytran.map = keytran.parent = Vkey_translation_map; 9200 keytran.map = keytran.parent = Vkey_translation_map;
9198 indec.start = indec.end = 0; 9201 indec.start = indec.end = 0;
9199 fkey.start = fkey.end = 0; 9202 fkey.start = fkey.end = 0;
9200 keytran.start = keytran.end = 0; 9203 keytran.start = keytran.end = 0;
9204
9205 /* We jump here when the key sequence has been thoroughly changed, and
9206 we need to rescan it starting from the beginning. When we jump here,
9207 keybuf[0..mock_input] holds the sequence we should reread. */
9208 replay_sequence:
9201 9209
9202 starting_buffer = current_buffer; 9210 starting_buffer = current_buffer;
9203 first_unbound = bufsize + 1; 9211 first_unbound = bufsize + 1;
9204 9212
9205 /* Build our list of keymaps. 9213 /* Build our list of keymaps.