]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fset_input_mode): Start polling, if appropriate.
authorRichard M. Stallman <rms@gnu.org>
Fri, 6 Aug 1993 21:17:16 +0000 (21:17 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 6 Aug 1993 21:17:16 +0000 (21:17 +0000)
At the beginning, stop polling.
Remove period from error message.
(stop_polling, start_polling): Check for interrupt_input.
(POLL_FOR_INPUT): Define whether or not target supports SIGIO.

src/keyboard.c

index c8e9e824b346fefd4ee87d5c21072fa1d8279f6d..b0534f1dd1fbf1656a03fe6eb1d96ae72d91d1f4 100644 (file)
@@ -430,13 +430,11 @@ int flow_control;
 #endif
 #endif
 
-/* If we support X Windows, and won't get an interrupt when input
-   arrives from the server, poll periodically so we can detect C-g.  */
+/* If we support X Windows, turn on the code to poll periodically
+   to detect C-g.  It isn't actually used when doing interrupt input.  */
 #ifdef HAVE_X_WINDOWS
-#ifndef SIGIO
 #define POLL_FOR_INPUT
 #endif
-#endif
 \f
 /* Global variable declarations.  */
 
@@ -1231,7 +1229,7 @@ input_poll_signal ()
 start_polling ()
 {
 #ifdef POLL_FOR_INPUT
-  if (read_socket_hook)
+  if (read_socket_hook && !interrupt_input)
     {
       poll_suppress_count--;
       if (poll_suppress_count == 0)
@@ -1249,7 +1247,7 @@ start_polling ()
 stop_polling ()
 {
 #ifdef POLL_FOR_INPUT
-  if (read_socket_hook)
+  if (read_socket_hook && !interrupt_input)
     {
       if (poll_suppress_count == 0)
        {
@@ -4932,7 +4930,11 @@ See also `current-input-mode'.")
   if (!NILP (quit)
       && (XTYPE (quit) != Lisp_Int
          || XINT (quit) < 0 || XINT (quit) > 0400))
-    error ("set-input-mode: QUIT must be an ASCII character.");
+    error ("set-input-mode: QUIT must be an ASCII character");
+
+#ifdef POLL_FOR_INPUT
+  stop_polling ();
+#endif
 
   reset_sys_modes ();
 #ifdef SIGIO
@@ -4962,6 +4964,11 @@ See also `current-input-mode'.")
     quit_char = XINT (quit) & (meta_key ? 0377 : 0177);
 
   init_sys_modes ();
+
+#ifdef POLL_FOR_INPUT
+  poll_suppress_count = 1;
+  start_polling ();
+#endif
   return Qnil;
 }