[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/process.c [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/src/process.c [lexbind] |
Date: |
Sat, 04 Sep 2004 05:41:49 -0400 |
Index: emacs/src/process.c
diff -c emacs/src/process.c:1.373.2.12 emacs/src/process.c:1.373.2.13
*** emacs/src/process.c:1.373.2.12 Sat Sep 4 09:19:27 2004
--- emacs/src/process.c Sat Sep 4 09:24:36 2004
***************
*** 3718,3724 ****
}
DEFUN ("accept-process-output", Faccept_process_output,
Saccept_process_output,
! 0, 3, 0,
doc: /* Allow any pending output from subprocesses to be read by Emacs.
It is read into the process' buffers or given to their filter functions.
Non-nil arg PROCESS means do not return until some output has been received
--- 3718,3724 ----
}
DEFUN ("accept-process-output", Faccept_process_output,
Saccept_process_output,
! 0, 4, 0,
doc: /* Allow any pending output from subprocesses to be read by Emacs.
It is read into the process' buffers or given to their filter functions.
Non-nil arg PROCESS means do not return until some output has been received
***************
*** 3726,3740 ****
Non-nil second arg TIMEOUT and third arg TIMEOUT-MSECS are number of
seconds and microseconds to wait; return after that much time whether
or not there is input.
Return non-nil iff we received any output before the timeout expired. */)
! (process, timeout, timeout_msecs)
! register Lisp_Object process, timeout, timeout_msecs;
{
int seconds;
int useconds;
if (! NILP (process))
CHECK_PROCESS (process);
if (! NILP (timeout_msecs))
{
--- 3726,3745 ----
Non-nil second arg TIMEOUT and third arg TIMEOUT-MSECS are number of
seconds and microseconds to wait; return after that much time whether
or not there is input.
+ If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
+ from PROCESS, suspending reading output from other processes.
+ If JUST-THIS-ONE is an integer, don't run any timers either.
Return non-nil iff we received any output before the timeout expired. */)
! (process, timeout, timeout_msecs, just_this_one)
! register Lisp_Object process, timeout, timeout_msecs, just_this_one;
{
int seconds;
int useconds;
if (! NILP (process))
CHECK_PROCESS (process);
+ else
+ just_this_one = Qnil;
if (! NILP (timeout_msecs))
{
***************
*** 3776,3782 ****
XSETFASTINT (process, 0);
return
! (wait_reading_process_input (seconds, useconds, process, 0)
? Qt : Qnil);
}
--- 3781,3789 ----
XSETFASTINT (process, 0);
return
! (wait_reading_process_input (seconds, useconds, process,
! NILP (just_this_one) ? 0 :
! !INTEGERP (just_this_one) ? -1 : -2)
? Qt : Qnil);
}
***************
*** 4009,4016 ****
process. The return value is true iff we read some input from
that process.
! DO_DISPLAY != 0 means redisplay should be done to show subprocess
! output that arrives.
If READ_KBD is a pointer to a struct Lisp_Process, then the
function returns true iff we received input from that process
--- 4016,4026 ----
process. The return value is true iff we read some input from
that process.
! If READ_KBD is a process object, DO_DISPLAY < 0 means handle only
! output from that process (suspending output from other processes)
! and DO_DISPLAY == -2 specifically means don't run any timers either.
! Otherwise, != 0 means redisplay should be done to show subprocess
! output that arrives.
If READ_KBD is a pointer to a struct Lisp_Process, then the
function returns true iff we received input from that process
***************
*** 4032,4037 ****
--- 4042,4048 ----
EMACS_TIME timeout, end_time;
int wait_channel = -1;
struct Lisp_Process *wait_proc = 0;
+ int just_wait_proc = 0;
int got_some_input = 0;
/* Either nil or a cons cell, the car of which is of interest and
may be changed outside of this routine. */
***************
*** 4048,4053 ****
--- 4059,4069 ----
wait_proc = XPROCESS (read_kbd);
wait_channel = XINT (wait_proc->infd);
XSETFASTINT (read_kbd, 0);
+ if (do_display < 0)
+ {
+ just_wait_proc = do_display;
+ do_display = 0;
+ }
}
/* If waiting for non-nil in a cell, record where. */
***************
*** 4122,4128 ****
But not if wait_for_cell; in those cases,
the wait is supposed to be short,
and those callers cannot handle running arbitrary Lisp code here. */
! if (NILP (wait_for_cell))
{
EMACS_TIME timer_delay;
--- 4138,4145 ----
But not if wait_for_cell; in those cases,
the wait is supposed to be short,
and those callers cannot handle running arbitrary Lisp code here. */
! if (NILP (wait_for_cell)
! && just_wait_proc != -2)
{
EMACS_TIME timer_delay;
***************
*** 4258,4264 ****
/* Wait till there is something to do */
! if (!NILP (wait_for_cell))
{
Available = non_process_wait_mask;
check_connect = check_delay = 0;
--- 4275,4286 ----
/* Wait till there is something to do */
! if (just_wait_proc)
! {
! FD_SET (XINT (wait_proc->infd), &Available);
! check_connect = check_delay = 0;
! }
! else if (!NILP (wait_for_cell))
{
Available = non_process_wait_mask;
check_connect = check_delay = 0;
***************
*** 5549,5577 ****
work. If the system has it, use it. */
#ifdef HAVE_TERMIOS
struct termios t;
switch (signo)
{
case SIGINT:
! tcgetattr (XINT (p->infd), &t);
! send_process (proc, &t.c_cc[VINTR], 1, Qnil);
! return;
case SIGQUIT:
! tcgetattr (XINT (p->infd), &t);
! send_process (proc, &t.c_cc[VQUIT], 1, Qnil);
! return;
case SIGTSTP:
- tcgetattr (XINT (p->infd), &t);
#if defined (VSWTCH) && !defined (PREFER_VSUSP)
! send_process (proc, &t.c_cc[VSWTCH], 1, Qnil);
#else
! send_process (proc, &t.c_cc[VSUSP], 1, Qnil);
#endif
! return;
}
#else /* ! HAVE_TERMIOS */
/* On Berkeley descendants, the following IOCTL's retrieve the
--- 5571,5610 ----
work. If the system has it, use it. */
#ifdef HAVE_TERMIOS
struct termios t;
+ cc_t *sig_char = NULL;
+
+ tcgetattr (XINT (p->infd), &t);
switch (signo)
{
case SIGINT:
! sig_char = &t.c_cc[VINTR];
! break;
case SIGQUIT:
! sig_char = &t.c_cc[VQUIT];
! break;
case SIGTSTP:
#if defined (VSWTCH) && !defined (PREFER_VSUSP)
! sig_char = &t.c_cc[VSWTCH];
#else
! sig_char = &t.c_cc[VSUSP];
#endif
! break;
}
+ #ifndef _POSIX_VDISABLE
+ #ifdef CVDISABLE
+ #define _POSIX_VDISABLE CVDISABLE
+ #else
+ #define _POSIX_VDISABLE '\0'
+ #endif
+ #endif
+
+ if (sig_char && *sig_char != _POSIX_VDISABLE)
+ send_process (proc, sig_char, 1, Qnil);
+ return;
#else /* ! HAVE_TERMIOS */
/* On Berkeley descendants, the following IOCTL's retrieve the