diff options
| author | Daiki Ueno | 2015-04-07 17:42:09 +0900 |
|---|---|---|
| committer | Daiki Ueno | 2015-04-11 07:59:27 +0900 |
| commit | f55ea05bdf60e24c09f9064fc0d2e8a114d6e358 (patch) | |
| tree | ed901f31fffe7afa1d4644dd9980042d7b35895b /doc | |
| parent | a2940cd43e7931d16d3a3ce2cf5d4acd148dd00c (diff) | |
| download | emacs-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.texi | 52 |
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} |
| 743 | Initialize the process sentinel to @var{sentinel}. | 743 | Initialize the process sentinel to @var{sentinel}. |
| 744 | |||
| 745 | @item :stderr @var{stderr} | ||
| 746 | Associate @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 | |||
| 751 | The original argument list, modified with the actual connection | ||
| 752 | information, is available via the @code{process-contact} function. | ||
| 753 | @end defun | ||
| 754 | |||
| 755 | @defun make-pipe-process &rest args | ||
| 756 | This function creates a bidirectional pipe which can be attached to a | ||
| 757 | child process (currently only useful with the @code{:stderr} keyword | ||
| 758 | of @code{make-process}). | ||
| 759 | |||
| 760 | The arguments @var{args} are a list of keyword/argument pairs. | ||
| 761 | Omitting a keyword is always equivalent to specifying it with value | ||
| 762 | @code{nil}, except for @code{:coding}. | ||
| 763 | Here are the meaningful keywords: | ||
| 764 | |||
| 765 | @table @asis | ||
| 766 | @item :name @var{name} | ||
| 767 | Use the string @var{name} as the process name. It is modified if | ||
| 768 | necessary to make it unique. | ||
| 769 | |||
| 770 | @item :buffer @var{buffer} | ||
| 771 | Use @var{buffer} as the process buffer. | ||
| 772 | |||
| 773 | @item :coding @var{coding} | ||
| 774 | If @var{coding} is a symbol, it specifies the coding system to be | ||
| 775 | used for both reading and writing of data from and to the | ||
| 776 | connection. If @var{coding} is a cons cell | ||
| 777 | @w{@code{(@var{decoding} . @var{encoding})}}, then @var{decoding} | ||
| 778 | will be used for reading and @var{encoding} for writing. | ||
| 779 | |||
| 780 | If @var{coding} is @code{nil}, the default rules for finding the | ||
| 781 | coding system will apply. @xref{Default Coding Systems}. | ||
| 782 | |||
| 783 | @item :noquery @var{query-flag} | ||
| 784 | Initialize the process query flag to @var{query-flag}. | ||
| 785 | @xref{Query Before Exit}. | ||
| 786 | |||
| 787 | @item :stop @var{stopped} | ||
| 788 | If @var{stopped} is non-@code{nil}, start the process in the | ||
| 789 | ``stopped'' state. | ||
| 790 | |||
| 791 | @item :filter @var{filter} | ||
| 792 | Initialize the process filter to @var{filter}. | ||
| 793 | |||
| 794 | @item :sentinel @var{sentinel} | ||
| 795 | Initialize the process sentinel to @var{sentinel}. | ||
| 744 | @end table | 796 | @end table |
| 745 | 797 | ||
| 746 | The original argument list, modified with the actual connection | 798 | The original argument list, modified with the actual connection |