emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Han


From: Michael Albinus
Subject: Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Handle shell commands.
Date: Sun, 20 Dec 2020 19:54:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]