]> code.delx.au - gnu-emacs/blobdiff - src/keyboard.c
(record_asynch_buffer_change): Don't test
[gnu-emacs] / src / keyboard.c
index e916bc7ee09fe05057928264042a1150ffc0a70b..96f0c651658c3dd0bf123c59db4b3bbb06e25ca4 100644 (file)
@@ -1296,9 +1296,11 @@ int polling_period;
 /* Nonzero means polling for input is temporarily suppressed.  */
 int poll_suppress_count;
 
-#ifdef POLL_FOR_INPUT
+/* Nonzero if polling_for_input is actually being used.  */
 int polling_for_input;
 
+#ifdef POLL_FOR_INPUT
+
 /* Handle an alarm once each second and read pending input
    so as to handle a C-g if it comces in.  */
 
@@ -1333,6 +1335,18 @@ start_polling ()
 #endif
 }
 
+/* Nonzero if we are using polling to handle input asynchronously.  */
+
+int
+input_polling_used ()
+{
+#ifdef POLL_FOR_INPUT
+  return read_socket_hook && !interrupt_input;
+#else
+  return 0;
+#endif
+}
+
 /* Turn off polling.  */
 
 stop_polling ()
@@ -1582,7 +1596,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
     {
       c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps);
       if (! NILP (c))
-       return c;
+       goto non_reread;
     }
 
   /* If in middle of key sequence and minibuffer not active,
@@ -3433,6 +3447,7 @@ record_asynch_buffer_change ()
   event.kind = buffer_switch_event;
   event.frame_or_window = Qnil;
 
+#ifdef subprocesses
   /* We don't need a buffer-switch event unless Emacs is waiting for input.
      The purpose of the event is to make read_key_sequence look up the
      keymaps again.  If we aren't in read_key_sequence, we don't need one,
@@ -3440,6 +3455,10 @@ record_asynch_buffer_change ()
   tem = Fwaiting_for_user_input_p ();
   if (NILP (tem))
     return;
+#else
+  /* We never need these events if we have no asynchronous subprocesses.  */
+  return;
+#endif
 
   /* Make sure no interrupt happens while storing the event.  */
 #ifdef SIGIO