unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: eliz@gnu.org
Cc: Philipp Stephani <phst@google.com>, 35328@debbugs.gnu.org
Subject: bug#35328: [PATCH] Improve documentation around standard error pipes (Bug#35328).
Date: Sun, 21 Apr 2019 18:11:47 +0200	[thread overview]
Message-ID: <20190421161147.29403-1-phst@google.com> (raw)
In-Reply-To: <CAArVCkT+VQNasm+ALN1j6wHoJLqqEB969vD66Bi4rMymFsbN4A@mail.gmail.com>

* doc/lispref/processes.texi (Asynchronous Processes): Document
existence and properties of the standard error process.
(Accepting Output): Document that one has to accept output from the
standard error process separately.
---
 doc/lispref/processes.texi | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 7eb136af5f..3af8a1d5eb 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -701,6 +701,18 @@ Asynchronous Processes
 @var{stderr} is @code{nil}, standard error is mixed with standard
 output, and both are sent to @var{buffer} or @var{filter}.
 
+If @var{stderr} is a buffer, Emacs will create a pipe process, the
+@dfn{standard error process}.  This process will have the default
+filter (@pxref{Filter Functions}), sentinel (@pxref{Sentinels}), and
+coding systems (@pxref{Default Coding Systems}).  On the other hand,
+it will use @var{query-flag} as its query-on-exit flag (@pxref{Query
+Before Exit}).  It will be associated with the @var{stderr} buffer
+(@pxref{Process Buffers}) and send its output (which is the standard
+error of the main process) there.
+
+If @var{stderr} is a pipe process, Emacs will use it as standard error
+process for the new process.
+
 @item :file-handler @var{file-handler}
 If @var{file-handler} is non-@code{nil}, then look for a file name
 handler for the current buffer's @code{default-directory}, and invoke
@@ -1882,6 +1894,18 @@ Accepting Output
 (while (accept-process-output process))
 @end example
 
+If you have passed a non-@code{nil} @var{stderr} to
+@code{make-process}, it will have a standard error process.
+@xref{Asynchronous Processes}.  In that case, waiting for process
+output from the main process doesn't wait for output from the standard
+error process.  To make sure that you have received both standard
+output and error from a process, use the following code:
+
+@example
+(while (accept-process-output process))
+(while (accept-process-output stderr-process))
+@end example
+
 @node Processes and Threads
 @subsection Processes and Threads
 @cindex processes, threads
-- 
2.20.1 (Apple Git-117)






  reply	other threads:[~2019-04-21 16:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 19:36 bug#35328: 27.0.50; Lisp reference, "Accepting Output": Should describe what happens to standard error Philipp
2019-04-20  7:12 ` Eli Zaretskii
2019-04-21 13:58   ` Philipp Stephani
2019-04-21 16:11     ` Philipp Stephani [this message]
2019-04-22  9:25       ` bug#35328: [PATCH] Improve documentation around standard error pipes (Bug#35328) Eli Zaretskii
2019-04-22 14:08         ` Philipp Stephani
2019-04-21 19:12     ` bug#35328: 27.0.50; Lisp reference, "Accepting Output": Should describe what happens to standard error Eli Zaretskii
2019-04-22  9:14       ` Philipp Stephani
2019-04-22  9:26         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190421161147.29403-1-phst@google.com \
    --to=p.stephani2@gmail.com \
    --cc=35328@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=phst@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).