From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#18515: 24.3; Documentation of `call-process' Date: Sun, 02 Apr 2017 09:41:48 -0400 Message-ID: <87a87zx6xv.fsf@users.sourceforge.net> References: <21534.17398.640167.807129@home.barzilay.org> <87vaqnxz8h.fsf@users.sourceforge.net> <87wpb3p8zb.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1491140482 13630 195.159.176.226 (2 Apr 2017 13:41:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Apr 2017 13:41:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: Eli Barzilay , 18515@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 02 15:41:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cufkh-0001p0-ER for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Apr 2017 15:41:07 +0200 Original-Received: from localhost ([::1]:55164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cufkn-0001TF-84 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Apr 2017 09:41:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cufkg-0001RZ-1c for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2017 09:41:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cufkc-0000pm-UY for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2017 09:41:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58301) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cufkc-0000pV-Op for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2017 09:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cufkc-0006ut-CW for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2017 09:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Apr 2017 13:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18515 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 18515-submit@debbugs.gnu.org id=B18515.149114043526542 (code B ref 18515); Sun, 02 Apr 2017 13:41:02 +0000 Original-Received: (at 18515) by debbugs.gnu.org; 2 Apr 2017 13:40:35 +0000 Original-Received: from localhost ([127.0.0.1]:56500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cufkA-0006tx-Uz for submit@debbugs.gnu.org; Sun, 02 Apr 2017 09:40:35 -0400 Original-Received: from mail-io0-f175.google.com ([209.85.223.175]:32809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cufk8-0006tc-Gb; Sun, 02 Apr 2017 09:40:33 -0400 Original-Received: by mail-io0-f175.google.com with SMTP id f84so61833521ioj.0; Sun, 02 Apr 2017 06:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=e0QSkMFYQBhdg/fSUNpKD7lJJGudwXfyeYxO38F7xUo=; b=jav4o+DzleL7U/JVHHk0kop4JWONnB4yiOybWXdMlBVo8EnnX+ZQTrUThI4M7qQ/V6 3Nm3qMdoBJb+i3jHc2rGZvN5Fkh+LJNSN6ZRCkCZJkYGBWjq2j5LCzGi3TnCeEUvr0OD T1KFHSzZEx4NmTjnuoI3K3Mz+dpYD8+CBNqEG8qyvtn25d1phdIla9nAlhhcujMWDsuq rGtvLZhAaII6DpbNhJacNTlHyFsIowKbH1/m4iG+Ef59Wf5VNJA6Vuzv/rgvWxIwM8U9 of+YAGIHRD61EJXJok97Rh4TSO8Bf9n1H9IgG7Q200aE5pO+xbyknYja4hDLq673I53I kj7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=e0QSkMFYQBhdg/fSUNpKD7lJJGudwXfyeYxO38F7xUo=; b=ZPp6BCNhFaUASWvWpDTMQdy75izWvychmj7O+TParCPiZpHE2pmsIV9uTu79guLPYg 9pwQ6JRLSMxIYKB/mRUQEXSBGMCXacoXOfXhND9GhwN+i1FCIXOFSGCuGVpFDzuz0s7X HJW4a3YWmoSyq2dAy1QNrFGlZRQFOVGTVD7Bk2LhJTvATo0zS1P8lKlK83kTFTyvVJ+w KF5CBI6mDENw9IXSOrzgKBq2/Nn1/M9cupviHw3epEHhFOiQbxqUhqluelaE3NW5lByE wT3wWyScn2ndsggSqDK/rh8HM9jq/P3xicMpuOIcctR1kBTgQ5ucsUhKTOecU1F+xpAG rINA== X-Gm-Message-State: AFeK/H24QpeNiyzYrL3lIRobqGk/znvf5Y5vjp5jJRsbWnRSLf3GhEKJRJnpPbELq0NS6w== X-Received: by 10.107.153.9 with SMTP id b9mr12428214ioe.200.1491140426921; Sun, 02 Apr 2017 06:40:26 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e20sm5745190itc.3.2017.04.02.06.40.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Apr 2017 06:40:25 -0700 (PDT) In-Reply-To: <87wpb3p8zb.fsf@detlef> (Michael Albinus's message of "Sun, 02 Apr 2017 09:24:56 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131209 Archived-At: --=-=-= Content-Type: text/plain retitle 18515 Document call-process behaviour with respect to default-directory quit Michael Albinus writes: >> +The process runs in `default-directory'. > > That's not true if `default-directory' is remote. Aha, good point. This is an important thing to document. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Mention-that-processes-start-in-default-directory.patch Content-Description: patch >From 6c450de9b474f1eb6255f8474b3dc5c5be81b9c7 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 1 Apr 2017 23:15:46 -0400 Subject: [PATCH v2] 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. --- doc/lispref/processes.texi | 9 ++++++++- lisp/subr.el | 7 ++++++- src/callproc.c | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 2a79cc781f..c76ca025d9 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -301,7 +301,9 @@ Synchronous Processes This function calls @var{program} and waits for it to finish. The current working directory of the subprocess is -@code{default-directory}. +@code{default-directory} if that is local (as determined by +@code{unhandled-file-name-directory}), or "~" otherwise. If you want +to run a process in a remote directory use @code{process-file}. The standard input for the new process comes from file @var{infile} if @var{infile} is not @code{nil}, and from the null device otherwise. @@ -677,6 +679,11 @@ Asynchronous Processes The original argument list, modified with the actual connection information, is available via the @code{process-contact} function. + +The current working directory of the subprocess is +@code{default-directory} if that is local (as determined by +`unhandled-file-name-directory'), or "~" otherwise. If you want to +run a process in a remote direcotry use @code{start-file-process}. @end defun @defun make-pipe-process &rest args diff --git a/lisp/subr.el b/lisp/subr.el index ebac2e0ef5..472f931306 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1970,7 +1970,12 @@ start-process If you want to separate standard output from standard error, use `make-process' or invoke the command through a shell and redirect -one of them using the shell syntax." +one of them using the shell syntax. + +The process runs in `default-directory' if that is local (as +determined by `unhandled-file-name-directory'), or \"~\" +otherwise. If you want to run a process in a remote directory +use `start-file-process'." (unless (fboundp 'make-process) (error "Emacs was compiled without subprocess support")) (apply #'make-process diff --git a/src/callproc.c b/src/callproc.c index 6d69e13757..a781e47b17 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -240,6 +240,10 @@ t (mix it with ordinary output), or a file name string. and returns a numeric exit status or a signal description string. If you quit, the process is killed with SIGINT, or SIGKILL if you quit again. +The process runs in `default-directory' if that is local (as +determined by `unhandled-file-name-directory'), or "~" otherwise. If +you want to run a process in a remote directory use `process-file'. + usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS) */) (ptrdiff_t nargs, Lisp_Object *args) { -- 2.11.1 --=-=-=--