6317 |
if (sec < 0 || (sec == 0 && usec == 0)) |
if (sec < 0 || (sec == 0 && usec == 0)) |
6318 |
return Qnil; |
return Qnil; |
6319 |
|
|
6320 |
{ |
wait_reading_process_output (sec, usec, 0, 0, Qnil, NULL, 0); |
|
Lisp_Object zero; |
|
|
|
|
|
XSETFASTINT (zero, 0); |
|
|
wait_reading_process_input (sec, usec, zero, 0); |
|
|
} |
|
|
|
|
|
/* We should always have wait_reading_process_input; we have a dummy |
|
|
implementation for systems which don't support subprocesses. */ |
|
|
#if 0 |
|
|
/* No wait_reading_process_input */ |
|
|
immediate_quit = 1; |
|
|
QUIT; |
|
|
|
|
|
#ifdef VMS |
|
|
sys_sleep (sec); |
|
|
#else /* not VMS */ |
|
|
/* The reason this is done this way |
|
|
(rather than defined (H_S) && defined (H_T)) |
|
|
is because the VMS preprocessor doesn't grok `defined'. */ |
|
|
#ifdef HAVE_SELECT |
|
|
EMACS_GET_TIME (end_time); |
|
|
EMACS_SET_SECS_USECS (timeout, sec, usec); |
|
|
EMACS_ADD_TIME (end_time, end_time, timeout); |
|
|
|
|
|
while (1) |
|
|
{ |
|
|
EMACS_GET_TIME (timeout); |
|
|
EMACS_SUB_TIME (timeout, end_time, timeout); |
|
|
if (EMACS_TIME_NEG_P (timeout) |
|
|
|| !select (1, 0, 0, 0, &timeout)) |
|
|
break; |
|
|
} |
|
|
#else /* not HAVE_SELECT */ |
|
|
sleep (sec); |
|
|
#endif /* HAVE_SELECT */ |
|
|
#endif /* not VMS */ |
|
|
|
|
|
immediate_quit = 0; |
|
|
#endif /* no subprocesses */ |
|
6321 |
|
|
6322 |
return Qnil; |
return Qnil; |
6323 |
} |
} |
6324 |
|
|
6325 |
|
|
6326 |
/* This is just like wait_reading_process_input, except that |
/* This is just like wait_reading_process_output, except that |
6327 |
it does the redisplay. |
it does the redisplay. |
6328 |
|
|
6329 |
It's also much like Fsit_for, except that it can be used for |
It's also much like Fsit_for, except that it can be used for |
6333 |
sit_for (sec, usec, reading, display, initial_display) |
sit_for (sec, usec, reading, display, initial_display) |
6334 |
int sec, usec, reading, display, initial_display; |
int sec, usec, reading, display, initial_display; |
6335 |
{ |
{ |
|
Lisp_Object read_kbd; |
|
|
|
|
6336 |
swallow_events (display); |
swallow_events (display); |
6337 |
|
|
6338 |
if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro)) |
if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro)) |
6348 |
gobble_input (0); |
gobble_input (0); |
6349 |
#endif |
#endif |
6350 |
|
|
6351 |
XSETINT (read_kbd, reading ? -1 : 1); |
wait_reading_process_output (sec, usec, reading ? -1 : 1, display, |
6352 |
wait_reading_process_input (sec, usec, read_kbd, display); |
Qnil, NULL, 0); |
6353 |
|
|
6354 |
return detect_input_pending () ? Qnil : Qt; |
return detect_input_pending () ? Qnil : Qt; |
6355 |
} |
} |