# HG changeset patch # User Chong Yidong # Date 1262700244 25200 # Node ID 04c6036b94377970478321fc671792a1c53ab128 # Parent 6efbdb23aea3be82a444976b9f3f039c607310b2 * keyboard.c (read_key_sequence): Catch keyboard switch after making a new tty frame (Bug#5095). diff -r 6efbdb23aea3 -r 04c6036b9437 src/ChangeLog --- a/src/ChangeLog Tue Jan 05 21:03:13 2010 +0900 +++ b/src/ChangeLog Tue Jan 05 07:04:04 2010 -0700 @@ -1,3 +1,8 @@ +2010-01-05 Chong Yidong + + * keyboard.c (read_key_sequence): Catch keyboard switch after + making a new tty frame (Bug#5095). + 2010-01-05 Kenichi Handa * fontset.c (fontset_find_font): Fix getting the frame pointer. diff -r 6efbdb23aea3 -r 04c6036b9437 src/keyboard.c --- a/src/keyboard.c Tue Jan 05 21:03:13 2010 +0900 +++ b/src/keyboard.c Tue Jan 05 07:04:04 2010 -0700 @@ -9502,7 +9502,13 @@ key = read_char (NILP (prompt), nmaps, (Lisp_Object *) submaps, last_nonmenu_event, &used_mouse_menu, NULL); - if (INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */ + if ((INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */ + /* When switching to a new tty (with a new keyboard), + read_char returns the new buffer, rather than -2 + (Bug#5095). This is because `terminal-init-xterm' + calls read-char, which eats the wrong_kboard_jmpbuf + return. Any better way to fix this? -- cyd */ + || (interrupted_kboard != current_kboard)) { int found = 0; struct kboard *k;