summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2005-12-12 02:37:01 +0000
committerKaroly Lorentey <lorentey@elte.hu>2005-12-12 02:37:01 +0000
commitd68058039e1ff5635b2e44509fc242de4f0a286f (patch)
tree407ca738e65d6bd9a7d37305c7cff86961de95ea
parentbe3d2d66d2dff979604134c5dc5fb506ded4aa54 (diff)
downloademacs-d68058039e1ff5635b2e44509fc242de4f0a286f.tar.gz
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
-rw-r--r--README.multi-tty24
-rw-r--r--src/coding.c4
-rw-r--r--src/keyboard.c22
3 files changed, 33 insertions, 17 deletions
diff --git a/README.multi-tty b/README.multi-tty
index ab43fc7c4e1..3f873facaec 100644
--- a/README.multi-tty
+++ b/README.multi-tty
@@ -31,9 +31,11 @@ The following is a (sadly incomplete) list of people who have
contributed to the project by testing, submitting patches, bug
reports, and suggestions. Thanks!
+Bernard Adrian <bernadrian@free.fr>
ARISAWA Akihiro <ari@mbf.ocn.ne.jp>
Vincent Bernat <bernat@luffy.cx>
Han Boetes <han@mijncomputer.nl>
+Damien Cassou <damien.cassou@laposte.net>
Robert J. Chassell <bob@rattlesnake.com>
Romain Francoise <romain@orebokech.com>
Ami Fischman <ami@fischman.org>
@@ -191,8 +193,8 @@ If you run Debian, or a distribution based on Debian, you are welcome
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 @@ The multi-tty branch is compiled the same way as Emacs itself:
make maintainer-clean # (If you have compiled Emacs before)
- ./configure <your favourite options>
+ ./configure --without-gtk <your favourite options>
make bootstrap
make install
@@ -391,6 +393,8 @@ THINGS TO DO
** 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 @@ THINGS TO DO
** 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 @@ THINGS TO DO
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 @@ DIARY OF CHANGES
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 @@ DIARY OF CHANGES
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 --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
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 --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)
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 @@ kbd_buffer_store_event_hold (event, hold_quit)
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 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
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 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
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;