diff options
| author | Daiki Ueno | 2015-03-23 12:40:29 +0900 |
|---|---|---|
| committer | Daiki Ueno | 2015-03-23 16:27:29 +0900 |
| commit | 47e0e319329a1ecf9da4fa1afd2b9f2738fada67 (patch) | |
| tree | 6260b8887776e71e448a62a707d6d15b5e3a1fcc /lisp | |
| parent | 165bea78008ec7545698f2e893821b4090f20c79 (diff) | |
| download | emacs-47e0e319329a1ecf9da4fa1afd2b9f2738fada67.tar.gz emacs-47e0e319329a1ecf9da4fa1afd2b9f2738fada67.zip | |
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 @@ | |||
| 1 | 2015-03-23 Daiki Ueno <ueno@gnu.org> | ||
| 2 | |||
| 3 | * subr.el (start-process): New function, ported from the C | ||
| 4 | implementation. | ||
| 5 | |||
| 1 | 2015-03-23 Daniel Colascione <dancol@dancol.org> | 6 | 2015-03-23 Daniel Colascione <dancol@dancol.org> |
| 2 | 7 | ||
| 3 | Automatically adjust process window sizes. | 8 | 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." | |||
| 1901 | 1901 | ||
| 1902 | ;;;; Process stuff. | 1902 | ;;;; Process stuff. |
| 1903 | 1903 | ||
| 1904 | (defun start-process (name buffer program &rest program-args) | ||
| 1905 | "Start a program in a subprocess. Return the process object for it. | ||
| 1906 | NAME is name for process. It is modified if necessary to make it unique. | ||
| 1907 | BUFFER is the buffer (or buffer name) to associate with the process. | ||
| 1908 | |||
| 1909 | Process output (both standard output and standard error streams) goes | ||
| 1910 | at end of BUFFER, unless you specify an output stream or filter | ||
| 1911 | function to handle the output. BUFFER may also be nil, meaning that | ||
| 1912 | this process is not associated with any buffer. | ||
| 1913 | |||
| 1914 | PROGRAM is the program file name. It is searched for in `exec-path' | ||
| 1915 | \(which see). If nil, just associate a pty with the buffer. Remaining | ||
| 1916 | arguments are strings to give program as arguments. | ||
| 1917 | |||
| 1918 | If you want to separate standard output from standard error, invoke | ||
| 1919 | the command through a shell and redirect one of them using the shell | ||
| 1920 | syntax." | ||
| 1921 | (unless (fboundp 'make-process) | ||
| 1922 | (error "Emacs was compiled without subprocess support")) | ||
| 1923 | (apply #'make-process | ||
| 1924 | (append (list :name name :buffer buffer) | ||
| 1925 | (if program | ||
| 1926 | (list :command (cons program program-args)))))) | ||
| 1927 | |||
| 1904 | (defun process-lines (program &rest args) | 1928 | (defun process-lines (program &rest args) |
| 1905 | "Execute PROGRAM with ARGS, returning its output as a list of lines. | 1929 | "Execute PROGRAM with ARGS, returning its output as a list of lines. |
| 1906 | Signal an error if the program returns with a non-zero exit status." | 1930 | Signal an error if the program returns with a non-zero exit status." |