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 12:25:52 -0400 Message-ID: <87wpb2wzcf.fsf@users.sourceforge.net> References: <21534.17398.640167.807129@home.barzilay.org> <87vaqnxz8h.fsf@users.sourceforge.net> <87wpb3p8zb.fsf@detlef> <87a87zx6xv.fsf@users.sourceforge.net> <831stareiy.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1491150321 9282 195.159.176.226 (2 Apr 2017 16:25:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Apr 2017 16:25:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: eli@barzilay.org, michael.albinus@gmx.de, 18515@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 02 18:25:15 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 1cuiJT-0000ye-2S for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Apr 2017 18:25:11 +0200 Original-Received: from localhost ([::1]:55658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuiJU-0000HN-E8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Apr 2017 12:25:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuiJO-0000FC-FN for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2017 12:25:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuiJK-0001Lg-GZ for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2017 12:25:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59482) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cuiJK-0001LT-Da for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2017 12:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cuiJK-00087r-5I for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2017 12:25: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 16:25: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.149115027831203 (code B ref 18515); Sun, 02 Apr 2017 16:25:02 +0000 Original-Received: (at 18515) by debbugs.gnu.org; 2 Apr 2017 16:24:38 +0000 Original-Received: from localhost ([127.0.0.1]:57681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuiIw-00087D-82 for submit@debbugs.gnu.org; Sun, 02 Apr 2017 12:24:38 -0400 Original-Received: from mail-it0-f50.google.com ([209.85.214.50]:36044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuiIu-00086z-FN for 18515@debbugs.gnu.org; Sun, 02 Apr 2017 12:24:36 -0400 Original-Received: by mail-it0-f50.google.com with SMTP id e75so35495020itd.1 for <18515@debbugs.gnu.org>; Sun, 02 Apr 2017 09:24:36 -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=V6QsE0TwkUBu5msjcQ1xoAikvCFjwtn4n54RO9/+014=; b=YiD+kj0TcT+tquxcBrFDFhIDh9VreCWrFnGQqrA6DeFxGgBennNDQoHHk014LyV33P slGpt6/d4qmshljSCaDH0uVvkr/ZeccckeX1mC3TsREydhgkuG3PoL9+RE9+ULAktrCD uBKWmzvjMth0OAgOsSkjAkeAQP2wy/adYaKAPiWwLjWDr1zOMpP+aTynK3JI5bdiqvSQ 0aX7aBHqKHmNYqeUfsVglV+1VN43o0Sj9ehflOnpY28d7NPTeOqqVdHv84346DH6RM3c 2vmi6YhGGxj9FSxchQDSff0MwV34nLNHH5j0MW7nzMCDDifHZstFIDEArmujU3HVWyHf d4GQ== 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=V6QsE0TwkUBu5msjcQ1xoAikvCFjwtn4n54RO9/+014=; b=lVlpe2JN7D0GHhNJWrEwInsZUZOZUjX419tGYQZ8IGXDZyhBZkWpor7MFY50er+OQn NMxRJr4vUoid6Ldk0FoY2QgcJtGOzttXB0btuZ4kGw0JE8+HGH+H7Ga8VorXsFz2Runx HbUYeDRnKXNl5egDC+AJXmIk4dkb1jQmw+6b7qGJy0l+bU+g6zNc2a6g35pYv/ndPubj T9vSOPoEDUOMReVYV338JpXtVbH3oKwpOmAL47xs3Hsmm4JytRSBlz/2p+okGZEKVgeI PUbWmDCGBA8p4I/G7UkCRS0/hKVgabh+eZvIQRAi/G6eiTvrdjWn+L3PWBJ1iS9/m6KT 6v8w== X-Gm-Message-State: AFeK/H1AShuT8Wb9se0uKCVUbNYrSxQAet5bnLTKbTXZzNUoRro55HxC po58MOlnPSVg+Q== X-Received: by 10.36.28.130 with SMTP id c124mr6640487itc.17.1491150270984; Sun, 02 Apr 2017 09:24:30 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id t7sm6407376ioe.22.2017.04.02.09.24.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Apr 2017 09:24:30 -0700 (PDT) In-Reply-To: <831stareiy.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 02 Apr 2017 18:54:29 +0300") 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:131221 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii 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. > > I think at least the manual should say that the default-directory > alluded to here is that of the buffer which is current when the > respective functions are called. Hmm, seems a bit obvious to me, but okay. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v3-0001-Mention-that-processes-start-in-default-directory.patch Content-Description: patch >From d750ec77e3f15c1cf4e94e288e097bc75904e5bd Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 1 Apr 2017 23:15:46 -0400 Subject: [PATCH v3] 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 | 13 +++++++++++-- lisp/subr.el | 7 ++++++- src/callproc.c | 4 ++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 2a79cc781f..2acb7c99e0 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -300,8 +300,11 @@ Synchronous Processes @defun call-process program &optional infile destination display &rest args This function calls @var{program} and waits for it to finish. -The current working directory of the subprocess is -@code{default-directory}. +The current working directory of the subprocess is set to the current +buffer's value of @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 +680,12 @@ 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 set to the current +buffer's value of @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 --=-=-=--