]> git.eshelyaron.com Git - emacs.git/commitdiff
* keyboard.c (read_key_sequence): Catch keyboard switch after
authorChong Yidong <cyd@stupidchicken.com>
Tue, 5 Jan 2010 14:04:04 +0000 (07:04 -0700)
committerChong Yidong <cyd@stupidchicken.com>
Tue, 5 Jan 2010 14:04:04 +0000 (07:04 -0700)
making a new tty frame (Bug#5095).

src/ChangeLog
src/keyboard.c

index 147ac60fce48019d579b1e4708175e3f48cd691a..77e80ed0536dbf1360b34b8f820be35bac8340d8 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-05  Chong Yidong  <cyd@stupidchicken.com>
+
+       * keyboard.c (read_key_sequence): Catch keyboard switch after
+       making a new tty frame (Bug#5095).
+
 2010-01-05  Kenichi Handa  <handa@m17n.org>
 
        * fontset.c (fontset_find_font): Fix getting the frame pointer.
index 7a137ea0dca97951c8684fc58c39300af05583fd..13d13cd3276944cae889a84153cbc716a1b13867 100644 (file)
@@ -9502,7 +9502,13 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
            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;