diff options
| author | Karoly Lorentey | 2005-12-12 02:37:01 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-12-12 02:37:01 +0000 |
| commit | d68058039e1ff5635b2e44509fc242de4f0a286f (patch) | |
| tree | 407ca738e65d6bd9a7d37305c7cff86961de95ea /src | |
| parent | be3d2d66d2dff979604134c5dc5fb506ded4aa54 (diff) | |
| download | emacs-d68058039e1ff5635b2e44509fc242de4f0a286f.tar.gz emacs-d68058039e1ff5635b2e44509fc242de4f0a286f.zip | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/coding.c | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 22 |
2 files changed, 15 insertions, 11 deletions
diff --git a/src/coding.c b/src/coding.c index 5658a8ab09a..d032f8c9483 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -7411,7 +7411,9 @@ DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_intern | |||
| 7411 | 7411 | ||
| 7412 | DEFUN ("keyboard-coding-system", Fkeyboard_coding_system, | 7412 | DEFUN ("keyboard-coding-system", Fkeyboard_coding_system, |
| 7413 | Skeyboard_coding_system, 0, 1, 0, | 7413 | Skeyboard_coding_system, 0, 1, 0, |
| 7414 | doc: /* Return coding system specified for decoding keyboard input. */) | 7414 | doc: /* Return coding system for decoding keyboard input on DEVICE. |
| 7415 | DEVICE may be a display device id, a frame, or nil for the selected | ||
| 7416 | frame's display device. */) | ||
| 7415 | (device) | 7417 | (device) |
| 7416 | Lisp_Object device; | 7418 | Lisp_Object device; |
| 7417 | { | 7419 | { |
diff --git a/src/keyboard.c b/src/keyboard.c index 51b59432214..4bc426222f0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2662,6 +2662,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 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); |
| @@ -3690,12 +3691,10 @@ kbd_buffer_store_event_hold (event, hold_quit) | |||
| 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), |
| @@ -8742,12 +8741,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 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)) |
| @@ -8787,6 +8781,14 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 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: |
| 8789 | 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; | ||
| 8791 | |||
| 8790 | starting_buffer = current_buffer; | 8792 | starting_buffer = current_buffer; |
| 8791 | first_unbound = bufsize + 1; | 8793 | first_unbound = bufsize + 1; |
| 8792 | 8794 | ||