@item :stderr @var{stderr}
Associate @var{stderr} with the standard error of the process. A
non-@code{nil} 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
+@var{stderr} 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
: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)
(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.