c->body = Qnil;
c->next = handlerlist;
c->lisp_eval_depth = lisp_eval_depth;
- c->poll_suppress_count = poll_suppress_count;
c->interrupt_input_blocked = interrupt_input_blocked;
c->ptag = make_prompt_tag ();
return c;
c->body = Qnil;
c->next = handlerlist;
c->lisp_eval_depth = lisp_eval_depth;
- c->poll_suppress_count = poll_suppress_count;
c->interrupt_input_blocked = interrupt_input_blocked;
c->ptag = make_prompt_tag ();
return c;
restore_handler (void *data)
{
struct handler *c = data;
- set_poll_suppress_count (c->poll_suppress_count);
unblock_input_to (c->interrupt_input_blocked);
immediate_quit = 0;
}
}
\f
-/* Nonzero means polling for input is temporarily suppressed. */
-
-int poll_suppress_count;
-
-
#ifdef POLL_FOR_INPUT
/* Asynchronous timer for polling. */
static void
poll_for_input (struct atimer *timer)
{
- if (poll_suppress_count == 0)
- pending_signals = 1;
}
#endif /* POLL_FOR_INPUT */
poll_timer = start_atimer (ATIMER_CONTINUOUS, interval,
poll_for_input, NULL);
}
-
- /* Let the timer's callback function poll for input
- if this becomes zero. */
- --poll_suppress_count;
}
#endif
}
#endif
}
-/* Turn off polling. */
-
-void
-stop_polling (void)
-{
-#ifdef POLL_FOR_INPUT
- /* XXX This condition was (read_socket_hook && !interrupt_input),
- but read_socket_hook is not global anymore. Let's pretend that
- it's always set. */
- if (!interrupt_input)
- ++poll_suppress_count;
-#endif
-}
-
-/* Set the value of poll_suppress_count to COUNT
- and start or stop polling accordingly. */
-
-void
-set_poll_suppress_count (int count)
-{
-#ifdef POLL_FOR_INPUT
- if (count == 0 && poll_suppress_count != 0)
- {
- poll_suppress_count = 1;
- start_polling ();
- }
- else if (count != 0 && poll_suppress_count == 0)
- {
- stop_polling ();
- }
- poll_suppress_count = count;
-#endif
-}
-
/* Bind polling_period to a value at least N.
But don't decrease it. */
bind_polling_period (int n)
{
#ifdef POLL_FOR_INPUT
- EMACS_INT new = polling_period;
+ EMACS_INT new = max (polling_period, new);
if (n > new)
new = n;
stop_other_atimers (poll_timer);
- stop_polling ();
specbind (Qpolling_period, make_number (new));
/* Start a new alarm with the new period. */
start_polling ();
Fset_window_configuration (window_config);
}
-#define STOP_POLLING \
-do { if (! polling_stopped_here) stop_polling (); \
- polling_stopped_here = 1; } while (0)
-
-#define RESUME_POLLING \
-do { if (polling_stopped_here) start_polling (); \
- polling_stopped_here = 0; } while (0)
-
static Lisp_Object
read_event_from_main_queue (struct timespec *end_time,
Lisp_Object local_tag,
wrong_kboard:
- STOP_POLLING;
-
if (NILP (c))
{
c = read_decoded_event_from_main_queue (end_time, local_getcjmp,
if (!end_time)
timer_stop_idle ();
- RESUME_POLLING;
if (NILP (c))
{
}
exit:
- RESUME_POLLING;
RETURN_UNGCPRO (c);
#undef commandflag
#undef map
hold_keyboard_input ();
if (!noninteractive)
ignore_sigio ();
- stop_polling ();
}
#endif /* subprocesses */
}
/* Start reading input again because we have processed enough to
be able to accept new events again. */
unhold_keyboard_input ();
- start_polling ();
}
#endif /* subprocesses */
event.arg = Qnil;
/* Make sure no interrupt happens while storing the event. */
-#ifdef USABLE_SIGIO
- if (interrupt_input)
- kbd_buffer_store_event (&event);
- else
-#endif
- {
- stop_polling ();
- kbd_buffer_store_event (&event);
- start_polling ();
- }
+ kbd_buffer_store_event (&event);
}
}
if (new_interrupt_input != interrupt_input)
{
-#ifdef POLL_FOR_INPUT
- stop_polling ();
-#endif
#ifndef DOS_NT
/* this causes startup screen to be restored and messes with the mouse */
reset_all_sys_modes ();
#endif
#ifdef POLL_FOR_INPUT
- poll_suppress_count = 1;
start_polling ();
#endif
}
#ifdef POLL_FOR_INPUT
poll_timer = NULL;
- poll_suppress_count = 1;
start_polling ();
#endif
}
/* Total number of times read_char has returned, modulo UINTMAX_MAX + 1. */
extern uintmax_t num_input_events;
-/* Nonzero means polling for input is temporarily suppressed. */
-extern int poll_suppress_count;
-
/* Vector holding the key sequence that invoked the current command.
It is reused for each command, and it may be longer than the current
sequence; this_command_key_count indicates how many elements
extern void record_asynch_buffer_change (void);
extern void input_poll_signal (int);
extern void start_polling (void);
-extern void stop_polling (void);
-extern void set_poll_suppress_count (int);
extern int gobble_input (void);
extern bool input_polling_used (void);
extern void clear_input_pending (void);
Lisp_Object body;
struct handler *next;
EMACS_INT lisp_eval_depth;
- int poll_suppress_count;
int interrupt_input_blocked;
};
/* Turn off periodic alarms (in case they are in use)
and then turn off any other atimers,
because the select emulator uses alarms. */
- stop_polling ();
turn_on_atimers (0);
while (1)
break;
}
- start_polling ();
+ turn_on_atimers (1);
return -1;
}
We used to raise a real alarm, but it seems that the handler
isn't always enabled here. This is probably a bug. */
if (input_polling_used ())
- {
- /* It could be confusing if a real alarm arrives while processing
- the fake one. Turn it off and let the handler reset it. */
- int old_poll_suppress_count = poll_suppress_count;
- poll_suppress_count = 1;
- poll_for_input_1 ();
- poll_suppress_count = old_poll_suppress_count;
- }
+ poll_for_input_1 ();
}
}
}
}
}
-#define STOP_POLLING \
-do { if (! polling_stopped_here) stop_polling (); \
- polling_stopped_here = 1; } while (0)
-
-#define RESUME_POLLING \
-do { if (polling_stopped_here) start_polling (); \
- polling_stopped_here = 0; } while (0)
-
-
/* Perhaps in the future avoid recentering windows if it
is not necessary; currently that causes some problems. */
signals, which can cause an apparent I/O error. */
if (interrupt_input)
unrequest_sigio ();
- STOP_POLLING;
pending |= update_frame (f, 0, 0);
f->cursor_type_changed = 0;
which can cause an apparent I/O error. */
if (interrupt_input)
unrequest_sigio ();
- STOP_POLLING;
if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf))
{
But it is much hairier to try to do anything about that. */
if (interrupt_input)
request_sigio ();
- RESUME_POLLING;
/* If a frame has become visible which was not before, redisplay
again, so that we display it. Expose events for such a frame
request_sigio ();
dynwind_end ();
- RESUME_POLLING;
}
that the handler isn't always enabled here. This is
probably a bug. */
if (input_polling_used ())
- {
- /* It could be confusing if a real alarm arrives while
- processing the fake one. Turn it off and let the
- handler reset it. */
- int old_poll_suppress_count = poll_suppress_count;
- poll_suppress_count = 1;
- poll_for_input_1 ();
- poll_suppress_count = old_poll_suppress_count;
- }
+ poll_for_input_1 ();
if (XPending (FRAME_X_DISPLAY (f)))
{