[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 8df23a8: Document that 'make-process' mixes the out
From: |
Philipp Stephani |
Subject: |
[Emacs-diffs] master 8df23a8: Document that 'make-process' mixes the output streams |
Date: |
Sat, 7 Apr 2018 16:16:57 -0400 (EDT) |
branch: master
commit 8df23a82042fa7dbaaa4377bc376d705595b073f
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>
Document that 'make-process' mixes the output streams
* doc/lispref/processes.texi (Asynchronous Processes):
* src/process.c (Fmake_process): Document that standard error is mixed
with standard output if STDERR is nil.
* test/src/process-tests.el (make-process/mix-stderr): New unit test.
---
doc/lispref/processes.texi | 4 +++-
src/process.c | 3 ++-
test/src/process-tests.el | 18 ++++++++++++++++++
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index af177e0..3e26f57 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -681,7 +681,9 @@ a default sentinel will be used, which can be overridden
later.
@item :stderr @var{stderr}
Associate @var{stderr} with the standard error of the process. A
address@hidden value should be either a buffer or a pipe process
-created with @code{make-pipe-process}, described below.
+created with @code{make-pipe-process}, described below. If
address@hidden is @code{nil}, standard error is mixed with standard
+output, and both are sent to @var{buffer} or @var{filter}.
@end table
The original argument list, modified with the actual connection
diff --git a/src/process.c b/src/process.c
index ed2cab7..c357a8b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1657,7 +1657,8 @@ to use a pty, or nil to use the default specified through
:stderr STDERR -- STDERR is either a buffer or a pipe process attached
to the standard error of subprocess. Specifying this implies
-`:connection-type' is set to `pipe'.
+`:connection-type' is set to `pipe'. If STDERR is nil, standard error
+is mixed with standard output and sent to BUFFER or FILTER.
usage: (make-process &rest ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index 7d35560..849676e 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -181,5 +181,23 @@
(should-not (process-query-on-exit-flag process))))
(kill-process process)))))
+(ert-deftest make-process/mix-stderr ()
+ "Check that ‘make-process’ mixes the output streams if STDERR is nil."
+ (skip-unless (executable-find shell-file-name))
+ (with-temp-buffer
+ (let ((process (make-process
+ :name "mix-stderr"
+ :command (list shell-file-name shell-command-switch
+ "echo stdout && echo stderr >&2")
+ :buffer (current-buffer)
+ :sentinel #'ignore
+ :noquery t
+ :connection-type 'pipe)))
+ (while (process-live-p process)
+ (accept-process-output process))
+ (should (eq (process-status process) 'exit))
+ (should (eq (process-exit-status process) 0))
+ (should (equal (buffer-string) "stdout\nstderr\n")))))
+
(provide 'process-tests)
;; process-tests.el ends here.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 8df23a8: Document that 'make-process' mixes the output streams,
Philipp Stephani <=