#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. */
start_polling ()
{
#ifdef POLL_FOR_INPUT
- if (read_socket_hook)
+ if (read_socket_hook && !interrupt_input)
{
poll_suppress_count--;
if (poll_suppress_count == 0)
stop_polling ()
{
#ifdef POLL_FOR_INPUT
- if (read_socket_hook)
+ if (read_socket_hook && !interrupt_input)
{
if (poll_suppress_count == 0)
{
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
quit_char = XINT (quit) & (meta_key ? 0377 : 0177);
init_sys_modes ();
+
+#ifdef POLL_FOR_INPUT
+ poll_suppress_count = 1;
+ start_polling ();
+#endif
return Qnil;
}