all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Handle shell commands.
Date: Fri, 18 Dec 2020 10:38:56 -0500	[thread overview]
Message-ID: <jwvr1nnrupp.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87czz787dk.fsf@gmx.de> (Michael Albinus's message of "Fri, 18 Dec 2020 16:24:23 +0100")

>>> +	;; Quote shell command.
>>> +	(when (and (= (length command) 3)
>>> +		   (stringp (nth 0 command))
>>> +		   (string-match-p "sh$" (nth 0 command))
>>> +		   (stringp (nth 1 command))
>>> +		   (string-equal "-c" (nth 1 command))
>>> +		   (stringp (nth 2 command)))
>>> +	  (setcar (cddr command) (tramp-shell-quote-argument (nth 2 command))))
>>
>> This looks odd (what is special about the quoting needs of "sh -c" which
>> wouldn't apply to other commands?).  Do you have some bug# or test case
>> associated to it so we can better understand why it's needed?
>
> See the thread "Tramp and conversion of \r\n into \n" in
> emacs-devel. Martin gave me tons of Tramp traces.
>
> I'm also not so happy with this special handling, and I expect we'll
> find a better solution. I'm still working on this.

I commend you make that clear in a comment (including a reference to
the relevant thread).

BTW, what would go wrong if you did
(setq command (mapcar #'tramp-shell-quote-argument command))?


        Stefan




  reply	other threads:[~2020-12-18 15:38 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 [this message]
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
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

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

  git send-email \
    --in-reply-to=jwvr1nnrupp.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.