From feb6546cdf5b43f8e50aaaabb29c6856a9251893 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 9 Jun 2014 13:31:06 -0700 Subject: [PATCH] Say (accept-process-output P)'s result pertains to P if P is non-nil. * doc/lispref/processes.texi (Accepting Output): * src/process.c (Faccept_process_output) (wait_reading_process_output): Mention that if PROCESS is non-nil, the return value is about PROCESS, not about other processes. --- doc/lispref/ChangeLog | 6 ++++++ doc/lispref/processes.texi | 5 +++-- src/ChangeLog | 7 +++++++ src/process.c | 25 ++++++++++++------------- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 93128962c33..d859e0f01a9 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,9 @@ +2014-06-09 Paul Eggert + + Say (accept-process-output P)'s result pertains to P if P is non-nil. + * processes.texi (Accepting Output): Mention that if PROCESS is non-nil, + the return value is about PROCESS, not about other processes. + 2014-06-08 Glenn Morris * os.texi (Startup Summary): Small fix for initial-buffer-choice. diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index c91afdffdeb..db80f0537e0 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -1484,7 +1484,7 @@ The arguments @var{seconds} and @var{millisec} let you specify timeout periods. The former specifies a period measured in seconds and the latter specifies one measured in milliseconds. The two time periods thus specified are added together, and @code{accept-process-output} -returns after that much time, whether or not there has been any +returns after that much time, even if there is no subprocess output. The argument @var{millisec} is obsolete (and should not be used), @@ -1502,7 +1502,8 @@ recommended, but may be necessary for specific applications, such as speech synthesis. The function @code{accept-process-output} returns non-@code{nil} if it -did get some output, or @code{nil} if the timeout expired before output +got output from @var{process}, or from any process if @var{process} is +@code{nil}. It returns @code{nil} if the timeout expired before output arrived. @end defun diff --git a/src/ChangeLog b/src/ChangeLog index 5fbf2e377e5..acddd01dc4f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2014-06-09 Paul Eggert + + Say (accept-process-output P)'s result pertains to P if P is non-nil. + * process.c (Faccept_process_output) + (wait_reading_process_output): Mention that if PROCESS is non-nil, + the return value is about PROCESS, not about other processes. + 2014-06-09 Dmitry Antipov Further adjustments to mark_object and friends. diff --git a/src/process.c b/src/process.c index b8b8eaaee5b..5006c85fe9d 100644 --- a/src/process.c +++ b/src/process.c @@ -3921,19 +3921,20 @@ 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 given to their filter functions. -Non-nil arg PROCESS means do not return until some output has been received -from PROCESS. +Optional argument PROCESS means do not return until output has been +received from PROCESS. -Non-nil second arg SECONDS and third arg MILLISEC are number of seconds -and milliseconds to wait; return after that much time whether or not -there is any subprocess output. If SECONDS is a floating point number, +Optional second argument SECONDS and third argument MILLISEC +specify a timeout; return after that much time even if there is +no subprocess output. If SECONDS is a floating point number, it specifies a fractional number of seconds to wait. The MILLISEC argument is obsolete and should be avoided. -If optional fourth arg JUST-THIS-ONE is non-nil, only accept output -from PROCESS, suspending reading output from other processes. +If optional fourth argument JUST-THIS-ONE is non-nil, accept output +from PROCESS only, suspending reading output from other processes. If JUST-THIS-ONE is an integer, don't run any timers either. -Return non-nil if we received any output before the timeout expired. */) +Return non-nil if we received any output from PROCESS (or, if PROCESS +is nil, from any process) before the timeout expired. */) (register Lisp_Object process, Lisp_Object seconds, Lisp_Object millisec, Lisp_Object just_this_one) { intmax_t secs; @@ -4255,16 +4256,14 @@ wait_reading_process_output_1 (void) (and gobble terminal input into the buffer if any arrives). If WAIT_PROC is specified, wait until something arrives from that - process. The return value is true if we read some input from - that process. + process. If JUST_WAIT_PROC is nonzero, handle only output from WAIT_PROC (suspending output from other processes). A negative value means don't run any timers either. - If WAIT_PROC is specified, then the function returns true if we - received input from that process before the timeout elapsed. - Otherwise, return true if we received input from any process. */ + Return true if we received input from WAIT_PROC, or from any + process if WAIT_PROC is null. */ bool wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, -- 2.39.5