diff options
| author | Noam Postavsky | 2017-04-01 23:15:46 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-04-06 18:50:54 -0400 |
| commit | c7ed57eaef46ed74ce926fc05dec9eaa5737f3d9 (patch) | |
| tree | c36467b24bef3f380c0608bb99aab201ceded29f | |
| parent | 856ec9ffa1fb4ff7e992b25bb0614ae168d5531e (diff) | |
| download | emacs-c7ed57eaef46ed74ce926fc05dec9eaa5737f3d9.tar.gz emacs-c7ed57eaef46ed74ce926fc05dec9eaa5737f3d9.zip | |
Mention that processes start in default-directory (Bug#18515)
* doc/lispref/processes.texi (Synchronous Processes):
(Asynchronous Processes):
* lisp/subr.el (start-process):
* src/callproc.c (call-process): Mention that the subprocess starts in
`default-directory' when local, suggest `start-file-process' and
`process-file' otherwise.
| -rw-r--r-- | doc/lispref/processes.texi | 13 | ||||
| -rw-r--r-- | lisp/subr.el | 7 | ||||
| -rw-r--r-- | src/callproc.c | 4 |
3 files changed, 21 insertions, 3 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 2a79cc781f8..2acb7c99e02 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -300,8 +300,11 @@ system, much like text written into a file. @xref{Coding Systems}. | |||
| 300 | @defun call-process program &optional infile destination display &rest args | 300 | @defun call-process program &optional infile destination display &rest args |
| 301 | This function calls @var{program} and waits for it to finish. | 301 | This function calls @var{program} and waits for it to finish. |
| 302 | 302 | ||
| 303 | The current working directory of the subprocess is | 303 | The current working directory of the subprocess is set to the current |
| 304 | @code{default-directory}. | 304 | buffer's value of @code{default-directory} if that is local (as |
| 305 | determined by @code{unhandled-file-name-directory}), or "~" otherwise. | ||
| 306 | If you want to run a process in a remote directory use | ||
| 307 | @code{process-file}. | ||
| 305 | 308 | ||
| 306 | The standard input for the new process comes from file @var{infile} if | 309 | The standard input for the new process comes from file @var{infile} if |
| 307 | @var{infile} is not @code{nil}, and from the null device otherwise. | 310 | @var{infile} is not @code{nil}, and from the null device otherwise. |
| @@ -677,6 +680,12 @@ created with @code{make-pipe-process}, described below. | |||
| 677 | 680 | ||
| 678 | The original argument list, modified with the actual connection | 681 | The original argument list, modified with the actual connection |
| 679 | information, is available via the @code{process-contact} function. | 682 | information, is available via the @code{process-contact} function. |
| 683 | |||
| 684 | The current working directory of the subprocess is set to the current | ||
| 685 | buffer's value of @code{default-directory} if that is local (as | ||
| 686 | determined by `unhandled-file-name-directory'), or "~" otherwise. If | ||
| 687 | you want to run a process in a remote direcotry use | ||
| 688 | @code{start-file-process}. | ||
| 680 | @end defun | 689 | @end defun |
| 681 | 690 | ||
| 682 | @defun make-pipe-process &rest args | 691 | @defun make-pipe-process &rest args |
diff --git a/lisp/subr.el b/lisp/subr.el index ebac2e0ef5d..472f931306e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1970,7 +1970,12 @@ arguments PROGRAM-ARGS are strings to give program as arguments. | |||
| 1970 | 1970 | ||
| 1971 | If you want to separate standard output from standard error, use | 1971 | If you want to separate standard output from standard error, use |
| 1972 | `make-process' or invoke the command through a shell and redirect | 1972 | `make-process' or invoke the command through a shell and redirect |
| 1973 | one of them using the shell syntax." | 1973 | one of them using the shell syntax. |
| 1974 | |||
| 1975 | The process runs in `default-directory' if that is local (as | ||
| 1976 | determined by `unhandled-file-name-directory'), or \"~\" | ||
| 1977 | otherwise. If you want to run a process in a remote directory | ||
| 1978 | use `start-file-process'." | ||
| 1974 | (unless (fboundp 'make-process) | 1979 | (unless (fboundp 'make-process) |
| 1975 | (error "Emacs was compiled without subprocess support")) | 1980 | (error "Emacs was compiled without subprocess support")) |
| 1976 | (apply #'make-process | 1981 | (apply #'make-process |
diff --git a/src/callproc.c b/src/callproc.c index 6d69e13757f..a781e47b171 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -240,6 +240,10 @@ Otherwise it waits for PROGRAM to terminate | |||
| 240 | and returns a numeric exit status or a signal description string. | 240 | and returns a numeric exit status or a signal description string. |
| 241 | If you quit, the process is killed with SIGINT, or SIGKILL if you quit again. | 241 | If you quit, the process is killed with SIGINT, or SIGKILL if you quit again. |
| 242 | 242 | ||
| 243 | The process runs in `default-directory' if that is local (as | ||
| 244 | determined by `unhandled-file-name-directory'), or "~" otherwise. If | ||
| 245 | you want to run a process in a remote directory use `process-file'. | ||
| 246 | |||
| 243 | usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS) */) | 247 | usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS) */) |
| 244 | (ptrdiff_t nargs, Lisp_Object *args) | 248 | (ptrdiff_t nargs, Lisp_Object *args) |
| 245 | { | 249 | { |