diff options
author | Daiki Ueno <ueno@gnu.org> | 2015-03-23 12:40:29 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2015-03-23 16:27:29 +0900 |
commit | 47e0e319329a1ecf9da4fa1afd2b9f2738fada67 (patch) | |
tree | 6260b8887776e71e448a62a707d6d15b5e3a1fcc /lisp | |
parent | 165bea78008ec7545698f2e893821b4090f20c79 (diff) | |
download | emacs-47e0e319329a1ecf9da4fa1afd2b9f2738fada67.tar.gz |
Generalize start-process with keyword args
* src/process.c (Fmake_process): New function.
(create_process, create_pty): Check p->pty_flag instead of
Vprocess_connection_type.
(syms_of_process): Register QCcommand, QCconnection_type, Qpty,
Qpipe, and Smake_process. Unregister Sstart_process.
* lisp/subr.el (start-process): New function, ported from the C
implementation.
* doc/lispref/processes.texi (Asynchronous Processes): Mention
`make-process'.
* etc/NEWS: Mention `make-process'.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/subr.el | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 596b6e2ccb5..8f1534a3284 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-23 Daiki Ueno <ueno@gnu.org> + + * subr.el (start-process): New function, ported from the C + implementation. + 2015-03-23 Daniel Colascione <dancol@dancol.org> Automatically adjust process window sizes. diff --git a/lisp/subr.el b/lisp/subr.el index deadca6efa0..163a1c419d4 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1901,6 +1901,30 @@ and the file name is displayed in the echo area." ;;;; Process stuff. +(defun start-process (name buffer program &rest program-args) + "Start a program in a subprocess. Return the process object for it. +NAME is name for process. It is modified if necessary to make it unique. +BUFFER is the buffer (or buffer name) to associate with the process. + +Process output (both standard output and standard error streams) goes +at end of BUFFER, unless you specify an output stream or filter +function to handle the output. BUFFER may also be nil, meaning that +this process is not associated with any buffer. + +PROGRAM is the program file name. It is searched for in `exec-path' +\(which see). If nil, just associate a pty with the buffer. Remaining +arguments are strings to give program as arguments. + +If you want to separate standard output from standard error, invoke +the command through a shell and redirect one of them using the shell +syntax." + (unless (fboundp 'make-process) + (error "Emacs was compiled without subprocess support")) + (apply #'make-process + (append (list :name name :buffer buffer) + (if program + (list :command (cons program program-args)))))) + (defun process-lines (program &rest args) "Execute PROGRAM with ARGS, returning its output as a list of lines. Signal an error if the program returns with a non-zero exit status." |