changeset 4471:31c5586e9d36

(Fset_input_mode): Start polling, if appropriate. 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.
author Richard M. Stallman <rms@gnu.org>
date Fri, 06 Aug 1993 21:17:16 +0000
parents 6dd518d1f5aa
children 951f354907d8
files src/keyboard.c
diffstat 1 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Fri Aug 06 21:06:10 1993 +0000
+++ b/src/keyboard.c	Fri Aug 06 21:17:16 1993 +0000
@@ -430,13 +430,11 @@
 #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
 
 /* Global variable declarations.  */
 
@@ -1231,7 +1229,7 @@
 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 @@
 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 @@
   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 @@
     quit_char = XINT (quit) & (meta_key ? 0377 : 0177);
 
   init_sys_modes ();
+
+#ifdef POLL_FOR_INPUT
+  poll_suppress_count = 1;
+  start_polling ();
+#endif
   return Qnil;
 }