From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Handle shell commands. Date: Sat, 19 Dec 2020 17:42:24 +0100 Message-ID: <877dpd4uj3.fsf@gmx.de> References: <20201218123338.4927.85373@vcs0.savannah.gnu.org> <20201218123339.A90E820B72@vcs0.savannah.gnu.org> <87czz787dk.fsf@gmx.de> <87y2hv5ch6.fsf@gmx.de> <87tusj58pw.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30702"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 19 17:43:19 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqfKB-0007tz-2a for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Dec 2020 17:43:19 +0100 Original-Received: from localhost ([::1]:39690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqfKA-0007X6-48 for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Dec 2020 11:43:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqfJT-00075i-8v for emacs-devel@gnu.org; Sat, 19 Dec 2020 11:42:35 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:48759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqfJP-0006Ld-Q3 for emacs-devel@gnu.org; Sat, 19 Dec 2020 11:42:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608396146; bh=97CMB6gJ1/vHcd/VFDVkJcYpKL5h+ozTPxULIzEZAME=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date; b=acoDWB/06auycEio5eieaMXYJAn+D1VbNeU8ZqqUeBXJekUVD5CmPNGyfLbtm6EBA Ht3mvP5p43JB07yrc4WLN8bpsCe/SvLOge7Nd9jd2dBP3VruvtwEgWCkpiSyC3tKgl jlQhA8TPMps4kyn+huLm1tlEiMqvKT8sLv7lFGac= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([217.70.140.12]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mj8qd-1kCOPM3f4H-00f8hz; Sat, 19 Dec 2020 17:42:25 +0100 X-Provags-ID: V03:K1:MLxPIzbpI2jgazPDktmGhTFnbbZkeGl5LRUEi2CrqQs3jMhG3z6 URmrGkJbsNBpswYjs4w+5EO45KMV//DOgiCWzUHL8sw9RMomOrNf0ACj3vady8PheNvO2wB oAfKyA1gq7M2PxvSUWjSeDY9KX9mVfAzxDin9ma40hEPlIPlSSZICQnPyUjnO0rhUCNr0d+ MnepOdrIitu9etjTRXsfA== X-UI-Out-Filterresults: notjunk:1;V03:K0:7xM2OVz0MGs=:Xt26yaR4tbxIYTviDSMXBM g2GqV6AklpE/GLuGeB++0xQz84/bAxU37skjAaVgHvWE0RLdRCI6aaD1kXEDQMjWqEC1/6DLg 7qBlFv2gbLjgIIXXvnsYeVUYHr7foVvn8hfYs+yPLpKiTsREupXT9TE4QqOjX8d7LaW1SQUP5 j3BLN2O3kFNsWMDxQPh3ATa3ir+IwMlwOMFEp1FeE601R8HLplgigE48dD8boBqqHwIDnhbqQ RHX9DgC+KTDbBD7rJKBf75+0V+rF/ULXr0EHI/IIk0esfS28tbaXQkQJFkOk5B0+YMwiokhOU S4B5nxBjGcMcFeHTwm92I2xRPAbeJG+K8w/d1P95dcfUyEy4wLpRXmaRTh+sSVlQLdRsxyj5Y ExG8rUX+/TiFlNbcX9XMc/tZ9joSsXgi1kLVsKcnXY5hr32OfAG6xUx9FGwM+ENHTiJ3bogPs vxObqRA/R88VgOi1rW/VqHrzF2hieF8JrNwqHDJ1RCdU5NDL2SwbDsz+DxOGXR4UsH9KzySoV DA4NRv/2nCNIZkTL17CdQlN14ZI/OW3+ISVkwgH7z2MGf7W/z0P/oD0AbSV1l8GU5jC04Z07U ZK+MQ6vudjExJBXwbqBfWMD10jt0I9F/XTtdKV4LQw+YQYh7MI+yhFXoEncGEZk2ZeX0zi8YP JZCKLSUYPKR8P0iuZgOc6T2WHTL097V31uzPJRK+tN4v7PoN2MJ/7TK92LucMbTd9AmqKmvDa 0BuFgiHLCZg7qrtQR9RWRv5ub34cKffvA5dIr6fUEqxrkcv+jwcw2YOawiSQpPp3lMJf/HJ5 Received-SPF: pass client-ip=212.227.15.19; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261259 Archived-At: Stefan Monnier 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. > > Any caller which passes several `args` should be fixed. > Any chance this is the problem you're seeing? > > If we disregard those wrong callers, the current definition is: > > (with-connection-local-variables > (start-file-process > name buffer > shell-file-name shell-command-switch command)) Perhaps. Let's go this way. I have changed the function to this definition, and I have recompiled all *.el files in Emacs master branch. No compilation error at least, which means everybody follows the calling conventions. > 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. Might work. However, some of my tests in tramp-tests.el fail now, and other tests still work. So I need to check what's up, before I commit. > Stefan Best regards, Michael.