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: Stefan Monnier
Subject: Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Handle shell commands.
Date: Sun, 20 Dec 2020 16:29:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> 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.

Thanks.

>> 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.

I'm glad we could find a less hackish solution (tho those levels of
quoting are involved, "hackish" is largely unavoidable).


        Stefan




reply via email to

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