unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Handle shell commands.
Date: Sun, 20 Dec 2020 19:54:02 +0100	[thread overview]
Message-ID: <87o8io9ulx.fsf@gmx.de> (raw)
In-Reply-To: <jwv1rfnrm46.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 18 Dec 2020 13:57:44 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

>> (defun start-file-process-shell-command (name buffer &rest args)
>>   "..."
>>   (with-connection-local-variables
>>    (start-file-process
>>     name buffer
>>     shell-file-name shell-command-switch
>>     (shell-quote-argument (mapconcat 'identity args " ")))))
>
> Concatenating arguments with a " " separator is plain wrong.
> That's why we have
>
>    (declare (advertised-calling-convention (name buffer command) "23.1"))
>
> so we can hopefully soon drop support for that concatenation.

I've dropped this.

> So the `command` doesn't need any quoting here: it's
> start-file-process's responsability to make sure it starts a process
> with those 3 strings (shell-file-name as the name of the executable,
> `shell-command-switch` as the first arg and `command` as the second).
>
> In the case of Tramp's implementation of `start-file-process`, you're
> going to run this process by constructing a command to send to the
> remote shell, so you'll indeed need to turn this list of strings
> into a single string and you need to do it by quoting those strings
> using the quoting that corresponds to that of the remote shell (which
> is indeed what `tramp-shell-quote-argument` does, IIUC).
> IOW, I'd expect `start-file-process` to do something like
>
>     (mapconcat #'tramp-shell-quote-argument args " ")
>
> to construct the command to send to the remote shell.

My recent patch (pushed) is along these lines. In
tramp-handle-make-process, but this is just an implementation detail.

It is a little bit more complicate, because it needs also some quoting
for the purpose of ssh, but it works for this.

There are still some problems when the connection is not performed via
ssh; this I will continue to investigate.

>         Stefan

Best regards, Michael.



  parent reply	other threads:[~2020-12-20 18:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201218123338.4927.85373@vcs0.savannah.gnu.org>
     [not found] ` <20201218123339.A90E820B72@vcs0.savannah.gnu.org>
2020-12-18 15:15   ` master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Handle shell commands Stefan Monnier
2020-12-18 15:24     ` Michael Albinus
2020-12-18 15:38       ` Stefan Monnier
2020-12-18 15:39         ` Stefan Monnier
2020-12-18 16:02         ` Michael Albinus
2020-12-18 16:28           ` Stefan Monnier
2020-12-18 17:23             ` Michael Albinus
2020-12-18 18:57               ` Stefan Monnier
2020-12-19 16:42                 ` Michael Albinus
2020-12-20 18:54                 ` Michael Albinus [this message]
2020-12-20 21:29                   ` Stefan Monnier
2020-12-18 16:30           ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8io9ulx.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).