aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDaiki Ueno2015-04-07 17:42:09 +0900
committerDaiki Ueno2015-04-11 07:59:27 +0900
commitf55ea05bdf60e24c09f9064fc0d2e8a114d6e358 (patch)
treeed901f31fffe7afa1d4644dd9980042d7b35895b /doc
parenta2940cd43e7931d16d3a3ce2cf5d4acd148dd00c (diff)
downloademacs-f55ea05bdf60e24c09f9064fc0d2e8a114d6e358.tar.gz
emacs-f55ea05bdf60e24c09f9064fc0d2e8a114d6e358.zip
Add facility to collect stderr of async subprocess
* src/w32.h (register_aux_fd): New function declaration. * src/w32.c (register_aux_fd): New function. * src/process.h (struct Lisp_Process): New member stderrproc. * src/process.c (PIPECONN_P): New macro. (PIPECONN1_P): New macro. (Fdelete_process, Fprocess_status, Fset_process_buffer) (Fset_process_filter, Fset_process_sentinel, Fstop_process) (Fcontinue_process): Handle pipe process specially. (create_process): Respect p->stderrproc. (Fmake_pipe_process): New function. (Fmake_process): Add new keyword argument :stderr. (wait_reading_process_output): Specially handle a pipe process when it gets an EOF. (syms_of_process): Register Qpipe and Smake_pipe_process. * doc/lispref/processes.texi (Asynchronous Processes): Document `make-pipe-process' and `:stderr' keyword of `make-process'. * lisp/subr.el (start-process): Suggest to use `make-process' handle standard error separately. * test/automated/process-tests.el (process-test-stderr-buffer) (process-test-stderr-filter): New tests. * etc/NEWS: Mention new process type `pipe' and its usage with the `:stderr' keyword of `make-process'.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/processes.texi52
1 files changed, 52 insertions, 0 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 3e9cc50de52..f228921137c 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -741,6 +741,58 @@ Initialize the process filter to @var{filter}.
741 741
742@item :sentinel @var{sentinel} 742@item :sentinel @var{sentinel}
743Initialize the process sentinel to @var{sentinel}. 743Initialize the process sentinel to @var{sentinel}.
744
745@item :stderr @var{stderr}
746Associate @var{stderr} with the standard error of the process.
747@var{stderr} is either a buffer or a pipe process created with
748@code{make-pipe-process}.
749@end table
750
751The original argument list, modified with the actual connection
752information, is available via the @code{process-contact} function.
753@end defun
754
755@defun make-pipe-process &rest args
756This function creates a bidirectional pipe which can be attached to a
757child process (currently only useful with the @code{:stderr} keyword
758of @code{make-process}).
759
760The arguments @var{args} are a list of keyword/argument pairs.
761Omitting a keyword is always equivalent to specifying it with value
762@code{nil}, except for @code{:coding}.
763Here are the meaningful keywords:
764
765@table @asis
766@item :name @var{name}
767Use the string @var{name} as the process name. It is modified if
768necessary to make it unique.
769
770@item :buffer @var{buffer}
771Use @var{buffer} as the process buffer.
772
773@item :coding @var{coding}
774If @var{coding} is a symbol, it specifies the coding system to be
775used for both reading and writing of data from and to the
776connection. If @var{coding} is a cons cell
777@w{@code{(@var{decoding} . @var{encoding})}}, then @var{decoding}
778will be used for reading and @var{encoding} for writing.
779
780If @var{coding} is @code{nil}, the default rules for finding the
781coding system will apply. @xref{Default Coding Systems}.
782
783@item :noquery @var{query-flag}
784Initialize the process query flag to @var{query-flag}.
785@xref{Query Before Exit}.
786
787@item :stop @var{stopped}
788If @var{stopped} is non-@code{nil}, start the process in the
789``stopped'' state.
790
791@item :filter @var{filter}
792Initialize the process filter to @var{filter}.
793
794@item :sentinel @var{sentinel}
795Initialize the process sentinel to @var{sentinel}.
744@end table 796@end table
745 797
746The original argument list, modified with the actual connection 798The original argument list, modified with the actual connection