# HG changeset patch # User Karoly Lorentey # Date 1134355021 0 # Node ID be1f74bffc1d3ab1c79eca4eaa46be156d545adc # Parent 39bb10ce301ad7d92ff648d777b7071f463b37fe 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 diff -r 39bb10ce301a -r be1f74bffc1d README.multi-tty --- a/README.multi-tty Sun Dec 11 22:42:40 2005 +0000 +++ b/README.multi-tty Mon Dec 12 02:37:01 2005 +0000 @@ -31,9 +31,11 @@ contributed to the project by testing, submitting patches, bug reports, and suggestions. Thanks! +Bernard Adrian ARISAWA Akihiro Vincent Bernat Han Boetes +Damien Cassou Robert J. Chassell Romain Francoise Ami Fischman @@ -191,8 +193,8 @@ to use our binary packages; put these lines in your /etc/apt/sources.list: # Multi-tty Emacs - deb http://aszt.inf.elte.hu/~lorentey/mirror/apt ./ - deb-src http://aszt.inf.elte.hu/~lorentey/mirror/apt ./ + deb http://aszt.inf.elte.hu/~lorentey/mirror/apt unstable multi-tty + deb-src http://aszt.inf.elte.hu/~lorentey/mirror/apt unstable multi-tty Note that these packages are intended solely to provide an easy way to test the new multi-tty features. They are not to be taken as Emacs @@ -208,7 +210,7 @@ make maintainer-clean # (If you have compiled Emacs before) - ./configure + ./configure --without-gtk make bootstrap make install @@ -391,6 +393,8 @@ ** Report GTK multi-display problems to GTK maintainers. For extra credit, fix them. +** Disable connecting to a new X display when we use the GTK toolkit. + ** Possibly turn off the double C-g feature when there is an X frame. C.f. (emacs)Emergency Escape. @@ -564,7 +568,7 @@ ** Dan Nicolaescu suggests that -nw should be added as an alias for -t in emacsclient. Good idea. (Alas, implementing this is not trivial, getopt_long does not seem to support two-letter ``short'' - options. Patches are welcome.) :-) + options. Patches are welcome.) ** Mark Plaksin suggests that emacsclient should accept the same X-related command-line arguments as Emacs. Most of the X-related @@ -608,6 +612,8 @@ useful. (Update: Look again. X unconditionally enables this, maybe that's why raw terminal support is broken again. I really do need to understand input.) + (Update: I am starting to understand the read_key_sequence->read-char + ->kbd_buffer_get_event->read_avail_input->read_socket_hook path. Yay!) ** flow-ctrl.el must be updated. @@ -914,7 +920,7 @@ frame that is dumped with Emacs. Checking for this frame (e.g. in cmd_error_internal) is ugly. - (Done, broking interactive temacs.) + (Done, breaking interactive temacs.) -- The command `emacsclient -t -e '(delete-frame)'' fails to exit. @@ -1264,7 +1270,13 @@ it is not recognized correctly. May be related to the bug below. (Seems to have been fixed as a side effect of patch-434. "The bug - below" was the set-input-mode madness.) + below" was the set-input-mode madness.) + + (Update: this bug was fixed for good in patch-449. It was tracked + down to a bug in `read_key_sequence': it failed to reinitialize its + local function-key-map/key-translation-map references when it + switched keyboards. I don't understand why did this bug only + appear on brand new frames, though!) ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d diff -r 39bb10ce301a -r be1f74bffc1d src/coding.c --- a/src/coding.c Sun Dec 11 22:42:40 2005 +0000 +++ b/src/coding.c Mon Dec 12 02:37:01 2005 +0000 @@ -7411,7 +7411,9 @@ DEFUN ("keyboard-coding-system", Fkeyboard_coding_system, Skeyboard_coding_system, 0, 1, 0, - doc: /* Return coding system specified for decoding keyboard input. */) + doc: /* Return coding system for decoding keyboard input on DEVICE. +DEVICE may be a display device id, a frame, or nil for the selected +frame's display device. */) (device) Lisp_Object device; { diff -r 39bb10ce301a -r be1f74bffc1d src/keyboard.c --- a/src/keyboard.c Sun Dec 11 22:42:40 2005 +0000 +++ b/src/keyboard.c Mon Dec 12 02:37:01 2005 +0000 @@ -2662,6 +2662,7 @@ if (_setjmp (local_getcjmp)) { + /* Handle quits while reading the keyboard. */ /* We must have saved the outer value of getcjmp here, so restore it now. */ restore_getcjmp (save_jump); @@ -3690,12 +3691,10 @@ if (c == quit_char) { #ifdef MULTI_KBOARD - KBOARD *kb; + KBOARD *kb = FRAME_KBOARD (XFRAME (event->frame_or_window)); struct input_event *sp; - if (single_kboard - && (kb = FRAME_KBOARD (XFRAME (event->frame_or_window)), - kb != current_kboard)) + if (single_kboard && kb != current_kboard) { kb->kbd_queue = Fcons (make_lispy_switch_frame (event->frame_or_window), @@ -8742,12 +8741,7 @@ last_nonmenu_event = Qnil; delayed_switch_frame = Qnil; - fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; - keytran.map = keytran.parent = current_kboard->Vlocal_key_translation_map; - /* If there is no translation-map, turn off scanning. */ - fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; - keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; - + if (INTERACTIVE) { if (!NILP (prompt)) @@ -8787,6 +8781,14 @@ keybuf[0..mock_input] holds the sequence we should reread. */ replay_sequence: + /* We may switch keyboards between rescans, so we need to + reinitialize fkey and keytran before each replay. */ + fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; + keytran.map = keytran.parent = current_kboard->Vlocal_key_translation_map; + /* If there is no translation map, turn off scanning. */ + fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; + keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; + starting_buffer = current_buffer; first_unbound = bufsize + 1;