]> code.delx.au - gnu-emacs/blobdiff - src/keyboard.c
(Finsert_file_contents): Delete incorrect decrement of specpdl_ptr.
[gnu-emacs] / src / keyboard.c
index e957e7e5c8f0af65c7ba03296dcbb9dd8cde40dd..cd18b91abf114454c9b3a3934ba266f9da1b5222 100644 (file)
@@ -1361,7 +1361,8 @@ top_level_1 ()
 }
 
 DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, "",
-       doc: /* Exit all recursive editing levels.  */)
+       doc: /* Exit all recursive editing levels.
+This also exits all active minibuffers.  */)
      ()
 {
 #ifdef HAVE_WINDOW_SYSTEM
@@ -7109,6 +7110,9 @@ tty_read_avail_input (struct terminal *terminal,
       while (gpm = Gpm_GetEvent (&event), gpm == 1) {
          nread += handle_one_term_event (tty, &event, &hold_quit);
       }
+      if (gpm < 0)
+       /* Presumably the GPM daemon has closed the connection.  */
+       close_gpm ();
       if (hold_quit.kind != NO_EVENT)
          kbd_buffer_store_event (&hold_quit);
       if (nread)
@@ -9153,16 +9157,10 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
   orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
   from_string = Qnil;
 
-  /* The multi-tty merge moved the code below to right after
-   `replay_sequence' which caused all these translation maps to be applied
-   repeatedly, even tho their doc says very clearly they are not applied to
-   their own output.
-   The reason for this move was: "We may switch keyboards between rescans,
-   so we need to reinitialize fkey and keytran before each replay".
-   This move was wrong (even if we switch keyboards, keybuf still holds the
-   keys we've read already from the original keyboard and some of those keys
-   may have already been translated).  So there may still be a bug out there
-   lurking.  */
+  /* We jump here when we need to reinitialize fkey and keytran; this
+     happens if we switch keyboards between rescans.  */
+ replay_entire_sequence:
+
   indec.map = indec.parent = current_kboard->Vinput_decode_map;
   fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map;
   keytran.map = keytran.parent = Vkey_translation_map;
@@ -9359,7 +9357,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
                    /* Don't touch interrupted_kboard when it's been
                       deleted. */
                    delayed_switch_frame = Qnil;
-                   goto replay_sequence;
+                   goto replay_entire_sequence;
                  }
 
                if (!NILP (delayed_switch_frame))
@@ -9391,7 +9389,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
                mock_input = 0;
                orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
                orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
-               goto replay_sequence;
+               goto replay_entire_sequence;
              }
          }