comparison src/keyboard.c @ 83409:be1f74bffc1d

Fix "first non-ASCII character on new tty frames" problem. * src/keyboard.c (kbd_buffer_store_event_hold): Simplify condition. (read_key_sequence): Reinitialize fkey and keytran at each replay. * src/coding.c (Fkeyboard_coding_system): Update doc. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-449
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 12 Dec 2005 02:37:01 +0000
parents 39bb10ce301a
children 14a4eb789b45
comparison
equal deleted inserted replaced
83408:39bb10ce301a 83409:be1f74bffc1d
2660 around any call to sit_for or kbd_buffer_get_event; 2660 around any call to sit_for or kbd_buffer_get_event;
2661 it *must not* be in effect when we call redisplay. */ 2661 it *must not* be in effect when we call redisplay. */
2662 2662
2663 if (_setjmp (local_getcjmp)) 2663 if (_setjmp (local_getcjmp))
2664 { 2664 {
2665 /* Handle quits while reading the keyboard. */
2665 /* We must have saved the outer value of getcjmp here, 2666 /* We must have saved the outer value of getcjmp here,
2666 so restore it now. */ 2667 so restore it now. */
2667 restore_getcjmp (save_jump); 2668 restore_getcjmp (save_jump);
2668 XSETINT (c, quit_char); 2669 XSETINT (c, quit_char);
2669 internal_last_event_frame = selected_frame; 2670 internal_last_event_frame = selected_frame;
3688 | hyper_modifier | super_modifier)); 3689 | hyper_modifier | super_modifier));
3689 3690
3690 if (c == quit_char) 3691 if (c == quit_char)
3691 { 3692 {
3692 #ifdef MULTI_KBOARD 3693 #ifdef MULTI_KBOARD
3693 KBOARD *kb; 3694 KBOARD *kb = FRAME_KBOARD (XFRAME (event->frame_or_window));
3694 struct input_event *sp; 3695 struct input_event *sp;
3695 3696
3696 if (single_kboard 3697 if (single_kboard && kb != current_kboard)
3697 && (kb = FRAME_KBOARD (XFRAME (event->frame_or_window)),
3698 kb != current_kboard))
3699 { 3698 {
3700 kb->kbd_queue 3699 kb->kbd_queue
3701 = Fcons (make_lispy_switch_frame (event->frame_or_window), 3700 = Fcons (make_lispy_switch_frame (event->frame_or_window),
3702 Fcons (make_number (c), Qnil)); 3701 Fcons (make_number (c), Qnil));
3703 kb->kbd_queue_has_data = 1; 3702 kb->kbd_queue_has_data = 1;
8740 raw_keybuf_count = 0; 8739 raw_keybuf_count = 0;
8741 8740
8742 last_nonmenu_event = Qnil; 8741 last_nonmenu_event = Qnil;
8743 8742
8744 delayed_switch_frame = Qnil; 8743 delayed_switch_frame = Qnil;
8745 fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; 8744
8746 keytran.map = keytran.parent = current_kboard->Vlocal_key_translation_map;
8747 /* If there is no translation-map, turn off scanning. */
8748 fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1;
8749 keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1;
8750
8751 if (INTERACTIVE) 8745 if (INTERACTIVE)
8752 { 8746 {
8753 if (!NILP (prompt)) 8747 if (!NILP (prompt))
8754 echo_prompt (prompt); 8748 echo_prompt (prompt);
8755 else if (cursor_in_echo_area 8749 else if (cursor_in_echo_area
8784 8778
8785 /* We jump here when the key sequence has been thoroughly changed, and 8779 /* We jump here when the key sequence has been thoroughly changed, and
8786 we need to rescan it starting from the beginning. When we jump here, 8780 we need to rescan it starting from the beginning. When we jump here,
8787 keybuf[0..mock_input] holds the sequence we should reread. */ 8781 keybuf[0..mock_input] holds the sequence we should reread. */
8788 replay_sequence: 8782 replay_sequence:
8783
8784 /* We may switch keyboards between rescans, so we need to
8785 reinitialize fkey and keytran before each replay. */
8786 fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map;
8787 keytran.map = keytran.parent = current_kboard->Vlocal_key_translation_map;
8788 /* If there is no translation map, turn off scanning. */
8789 fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1;
8790 keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1;
8789 8791
8790 starting_buffer = current_buffer; 8792 starting_buffer = current_buffer;
8791 first_unbound = bufsize + 1; 8793 first_unbound = bufsize + 1;
8792 8794
8793 /* Build our list of keymaps. 8795 /* Build our list of keymaps.