From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Patch of shell-command-to-string in simple for tramp support Date: Thu, 25 Jan 2018 14:08:21 +0100 Message-ID: <87efme5bne.fsf@gmx.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1516885605 11902 195.159.176.226 (25 Jan 2018 13:06:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 25 Jan 2018 13:06:45 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Shuguang Sun Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 25 14:06:40 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eehEf-0002GN-He for ged-emacs-devel@m.gmane.org; Thu, 25 Jan 2018 14:06:33 +0100 Original-Received: from localhost ([::1]:39506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eehGd-0005yJ-Tc for ged-emacs-devel@m.gmane.org; Thu, 25 Jan 2018 08:08:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eehGV-0005xW-Mk for emacs-devel@gnu.org; Thu, 25 Jan 2018 08:08:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eehGS-00047w-He for emacs-devel@gnu.org; Thu, 25 Jan 2018 08:08:27 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:59840) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eehGS-00047d-89 for emacs-devel@gnu.org; Thu, 25 Jan 2018 08:08:24 -0500 Original-Received: from detlef.gmx.de ([79.140.117.159]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MTjMy-1eEGQf3pVg-00QPx3; Thu, 25 Jan 2018 14:08:22 +0100 In-Reply-To: (Shuguang Sun's message of "Thu, 25 Jan 2018 20:11:08 +0800") X-Provags-ID: V03:K0:KtfuDnLK/E/cXXMyKv2WpCDqItXG3QqUoughRMU+yG4rEziNh2M imdvoayPVkMi4xSAhYTwweYvMQVmQvGvdHDloEDz9idt/KAdjZA0SqdxnUDo7RnrsusDjF8 +xuA+efGnVrKxCp79l2JdeOC2OHYVIFKYaDpvPCrPhZLSDqxAv+YfkkaFkMgQaTv2NJDuut AngVwxmjXVxMDlNqA22QQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:spQhkhEVSDc=:5sT3Ow8dJ9hhbDsmLgBtdE GX3HfApyUhuEU6gBMWOOFlAlsWYHz2oDXDzzMfZhRFAKDC14U15kMNYt500krk049R9Rc0l49 gtaR9DwII3I+Ovn38ZTPV1CjmvyJEehUnUjYxFW2e5z/iUyIcPgJaQ1zfJEaPe9Kbw/zmuPyt qTMtJDeJZd7ha7OFvAbRzCQPk4e4XBm1dx6oZDyvoTVxwuMIjGqh3z/cuoKR0WEMU3UWcx2jp ziQFmTqCB6j6kG+ZbMrCaY4m8WqFw9TtTJANBX0JJHy/qYj2X1ia8IaH56O0us6DqQphVX/3i 8irX6e78GB0X94NrV/lteEl/WPeoc6KThooCalyQqMSy/8bJNgSqjOW0oBhgqW8x1v8gVDdLL CzNZ/aIHpzLAw9a6k3h/qwQU5kdBK5tFbQPDEuvEoSzPqihxgc7xvTpKfKlgp5l2PjUBzxAEU IgY1LxrnhVDTfHyAW9z53vv+sIX92mRW7weBKVBxHovGqG73V126j41ICNa1bJJe+HnO9PlUN rkteLWJbp0Yz7P/KO5aNRlNM6dGzImPH5A4jViapV+TRr3WUT8fL/l2QtyFTJGUZmt8ck62HV C4GwNP8caBNsOrpI3EVBV507mAJemPWC4K8d4tHG6Wr8FXMTl+cvbP4uaKPnQwIxi9HZ0xtfS 3Vfy3C00xpv4U8HDXSB8+V5S8m3Q/fHqD6oTpZFlj8h7EA4+luIZgvG+Bygyjvs/AGhQzX+T2 2WPd0kN446J2+cFfwJngjFtFiTF+wqqlCX/xVIGBjPwdA4hm9LW8PgK7rvTwI7QkwpPzxHbB X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:222223 Archived-At: Shuguang Sun writes: > Hi, Hi Shuguang, > The shell-command-to-string calls shell-file-name directly and it > doesn't work in the case of local Windows and remoter Unix. I borrow > the some code from shell.el and make a patch to simple.el. I believe it is wrong to make `shell-command-to-string' Tramp-aware. We have `shell-command', which runs a (Tramp) file name handler if needed. The proper change should be: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/simple.el b/lisp/simple.el index e51bc132a6..44f738f07e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3844,7 +3844,7 @@ shell-command-to-string (with-output-to-string (with-current-buffer standard-output - (process-file shell-file-name nil t nil shell-command-switch command)))) + (shell-command command t)))) (defun process-file (program &optional infile buffer display &rest args) "Process files synchronously in a separate process. --8<---------------cut here---------------end--------------->8--- Could you, pls, test it in your environment? > Best Regards, > Shuguang Best regards, Michael.