diff options
| author | Paul Eggert | 2018-12-27 12:52:45 -0800 |
|---|---|---|
| committer | Paul Eggert | 2018-12-27 12:53:54 -0800 |
| commit | c9fdd1b4965ebd02aa408f878320c4955f5e2cc7 (patch) | |
| tree | 377aa59b8ff670a6fb3b08a63b88235961f413ac | |
| parent | 9578c2aa2201642e6846b0d09c14e72bc3225d09 (diff) | |
| download | emacs-c9fdd1b4965ebd02aa408f878320c4955f5e2cc7.tar.gz emacs-c9fdd1b4965ebd02aa408f878320c4955f5e2cc7.zip | |
Improve accept-process-process doc
* doc/lispref/processes.texi (Accepting Output):
* src/process.c (Faccept_process_output):
Document that (accept-process-output P) can return non-nil
even after P has exited, and that it can return nil even if P
is still running (Bug#33839).
| -rw-r--r-- | doc/lispref/processes.texi | 7 | ||||
| -rw-r--r-- | src/process.c | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 623be09cc63..2aca7f82a1a 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -1795,7 +1795,8 @@ until output arrives from a process. | |||
| 1795 | This function allows Emacs to read pending output from processes. The | 1795 | This function allows Emacs to read pending output from processes. The |
| 1796 | output is given to their filter functions. If @var{process} is | 1796 | output is given to their filter functions. If @var{process} is |
| 1797 | non-@code{nil} then this function does not return until some output | 1797 | non-@code{nil} then this function does not return until some output |
| 1798 | has been received from @var{process}. | 1798 | has been received from @var{process} or @var{process} has closed the |
| 1799 | connection. | ||
| 1799 | 1800 | ||
| 1800 | The arguments @var{seconds} and @var{millisec} let you specify timeout | 1801 | The arguments @var{seconds} and @var{millisec} let you specify timeout |
| 1801 | periods. The former specifies a period measured in seconds and the | 1802 | periods. The former specifies a period measured in seconds and the |
| @@ -1820,7 +1821,9 @@ speech synthesis. | |||
| 1820 | 1821 | ||
| 1821 | The function @code{accept-process-output} returns non-@code{nil} if it | 1822 | The function @code{accept-process-output} returns non-@code{nil} if it |
| 1822 | got output from @var{process}, or from any process if @var{process} is | 1823 | got output from @var{process}, or from any process if @var{process} is |
| 1823 | @code{nil}. It returns @code{nil} if the timeout expired before output | 1824 | @code{nil}; this can occur even after a process has exited if the |
| 1825 | corresponding connection contains buffered data. The function returns | ||
| 1826 | @code{nil} if the timeout expired or the connection was closed before output | ||
| 1824 | arrived. | 1827 | arrived. |
| 1825 | @end defun | 1828 | @end defun |
| 1826 | 1829 | ||
diff --git a/src/process.c b/src/process.c index e306b2ae9ec..4dafee8cbed 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4581,8 +4581,8 @@ DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output, | |||
| 4581 | 0, 4, 0, | 4581 | 0, 4, 0, |
| 4582 | doc: /* Allow any pending output from subprocesses to be read by Emacs. | 4582 | doc: /* Allow any pending output from subprocesses to be read by Emacs. |
| 4583 | It is given to their filter functions. | 4583 | It is given to their filter functions. |
| 4584 | Optional argument PROCESS means do not return until output has been | 4584 | Optional argument PROCESS means to return only after output is |
| 4585 | received from PROCESS. | 4585 | received from PROCESS or PROCESS closes the connection. |
| 4586 | 4586 | ||
| 4587 | Optional second argument SECONDS and third argument MILLISEC | 4587 | Optional second argument SECONDS and third argument MILLISEC |
| 4588 | specify a timeout; return after that much time even if there is | 4588 | specify a timeout; return after that much time even if there is |
| @@ -4594,7 +4594,8 @@ If optional fourth argument JUST-THIS-ONE is non-nil, accept output | |||
| 4594 | from PROCESS only, suspending reading output from other processes. | 4594 | from PROCESS only, suspending reading output from other processes. |
| 4595 | If JUST-THIS-ONE is an integer, don't run any timers either. | 4595 | If JUST-THIS-ONE is an integer, don't run any timers either. |
| 4596 | Return non-nil if we received any output from PROCESS (or, if PROCESS | 4596 | Return non-nil if we received any output from PROCESS (or, if PROCESS |
| 4597 | is nil, from any process) before the timeout expired. */) | 4597 | is nil, from any process) before the timeout expired or the |
| 4598 | corresponding connection was closed. */) | ||
| 4598 | (Lisp_Object process, Lisp_Object seconds, Lisp_Object millisec, | 4599 | (Lisp_Object process, Lisp_Object seconds, Lisp_Object millisec, |
| 4599 | Lisp_Object just_this_one) | 4600 | Lisp_Object just_this_one) |
| 4600 | { | 4601 | { |