aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2019-07-26 23:20:37 -0400
committerNoam Postavsky2019-08-19 19:49:50 -0400
commit615cff42580a3521c1a4ea7c3ec467eb8259e1c7 (patch)
tree29a8aed75dabb24a797d5d6a9c3228c0e99535e1
parentbeb1d22260af2e03d80d34fcc1db212785a9d903 (diff)
downloademacs-615cff42580a3521c1a4ea7c3ec467eb8259e1c7.tar.gz
emacs-615cff42580a3521c1a4ea7c3ec467eb8259e1c7.zip
Fix process filter documentation (Bug#13400)
* doc/lispref/processes.texi (Asynchronous Processes): Note that input may read when sending data as well. (Output from Processes): Note that functions which send data may also trigger reading from processes. (Input to Processes, Filter Functions): Note that filter functions may be called recursively.
-rw-r--r--doc/lispref/processes.texi29
1 files changed, 13 insertions, 16 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index a93f4db4282..bd807cdceef 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -588,9 +588,8 @@ process}. After an asynchronous process is created, it runs in
588parallel with Emacs, and Emacs can communicate with it using the 588parallel with Emacs, and Emacs can communicate with it using the
589functions described in the following sections (@pxref{Input to 589functions described in the following sections (@pxref{Input to
590Processes}, and @pxref{Output from Processes}). Note that process 590Processes}, and @pxref{Output from Processes}). Note that process
591communication is only partially asynchronous: Emacs sends data to the 591communication is only partially asynchronous: Emacs sends and receives
592process only when certain functions are called, and Emacs accepts data 592data to and from a process only when those functions are called.
593from the process only while waiting for input or for a time delay.
594 593
595@cindex pty, when to use for subprocess communications 594@cindex pty, when to use for subprocess communications
596@cindex pipe, when to use for subprocess communications 595@cindex pipe, when to use for subprocess communications
@@ -1200,8 +1199,9 @@ the defaulting mechanism (@pxref{Default Coding Systems}).
1200because the input buffer is full. When this happens, the send functions 1199because the input buffer is full. When this happens, the send functions
1201wait a short while, accepting output from subprocesses, and then try 1200wait a short while, accepting output from subprocesses, and then try
1202again. This gives the subprocess a chance to read more of its pending 1201again. This gives the subprocess a chance to read more of its pending
1203input and make space in the buffer. It also allows filters, sentinels 1202input and make space in the buffer. It also allows filters (including
1204and timers to run---so take account of that in writing your code. 1203the one currently running), sentinels and timers to run---so take
1204account of that in writing your code.
1205 1205
1206 In these functions, the @var{process} argument can be a process or 1206 In these functions, the @var{process} argument can be a process or
1207the name of a process, or a buffer or buffer name (which stands 1207the name of a process, or a buffer or buffer name (which stands
@@ -1416,9 +1416,10 @@ output, Emacs won't receive that output.
1416 1416
1417 Output from a subprocess can arrive only while Emacs is waiting: when 1417 Output from a subprocess can arrive only while Emacs is waiting: when
1418reading terminal input (see the function @code{waiting-for-user-input-p}), 1418reading terminal input (see the function @code{waiting-for-user-input-p}),
1419in @code{sit-for} and @code{sleep-for} (@pxref{Waiting}), and in 1419in @code{sit-for} and @code{sleep-for} (@pxref{Waiting}), in
1420@code{accept-process-output} (@pxref{Accepting Output}). This 1420@code{accept-process-output} (@pxref{Accepting Output}), and in
1421minimizes the problem of timing errors that usually plague parallel 1421functions which send data to processes (@pxref{Input to Processes}).
1422This minimizes the problem of timing errors that usually plague parallel
1422programming. For example, you can safely create a process and only 1423programming. For example, you can safely create a process and only
1423then specify its buffer or filter function; no output can arrive 1424then specify its buffer or filter function; no output can arrive
1424before you finish, if the code in between does not call any primitive 1425before you finish, if the code in between does not call any primitive
@@ -1594,14 +1595,10 @@ outputs directly to the process buffer.
1594 By default, the error output from the process, if any, is also 1595 By default, the error output from the process, if any, is also
1595passed to the filter function, unless the destination for the standard 1596passed to the filter function, unless the destination for the standard
1596error stream of the process was separated from the standard output 1597error stream of the process was separated from the standard output
1597when the process was created (@pxref{Output from Processes}). 1598when the process was created. Emacs will only call the filter
1598 1599function during certain function calls. @xref{Output from Processes}.
1599 The filter function can only be called when Emacs is waiting for 1600Note that if any of those functions are called by the filter, the
1600something, because process output arrives only at such times. Emacs 1601filter may be called recursively.
1601waits when reading terminal input (see the function
1602@code{waiting-for-user-input-p}), in @code{sit-for} and
1603@code{sleep-for} (@pxref{Waiting}), and in
1604@code{accept-process-output} (@pxref{Accepting Output}).
1605 1602
1606 A filter function must accept two arguments: the associated process 1603 A filter function must accept two arguments: the associated process
1607and a string, which is output just received from it. The function is 1604and a string, which is output just received from it. The function is