From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Patch of shell-command-to-string in simple for tramp support Date: Thu, 25 Jan 2018 09:12:03 -0500 Message-ID: References: <87efme5bne.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1516889637 31058 195.159.176.226 (25 Jan 2018 14:13:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 25 Jan 2018 14:13:57 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 25 15:13:53 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 1eeiHk-0007Pw-HH for ged-emacs-devel@m.gmane.org; Thu, 25 Jan 2018 15:13:48 +0100 Original-Received: from localhost ([::1]:42614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeiJj-0002aE-3F for ged-emacs-devel@m.gmane.org; Thu, 25 Jan 2018 09:15:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeiGh-0000p6-93 for emacs-devel@gnu.org; Thu, 25 Jan 2018 09:12:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeiGd-0007lk-9q for emacs-devel@gnu.org; Thu, 25 Jan 2018 09:12:43 -0500 Original-Received: from [195.159.176.226] (port=51986 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeiGd-0007jQ-1I for emacs-devel@gnu.org; Thu, 25 Jan 2018 09:12:39 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eeiEF-0003bz-Bu for emacs-devel@gnu.org; Thu, 25 Jan 2018 15:10:11 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:mT9aHCGRQn1+M9C1un8kwb4F9Eg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:222227 Archived-At: > @@ -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. shell-command does a *lot* more than run shell-file-name with shell-command-switch and for the purpose of shell-command-to-string Could you give more details about why you think using process-file here is wrong? BTW, I have my own reservations w.r.t shell-command-to-string: a quick grep for that function shows that the vast majority of its users don't actually need a shell, so it would make sense to provide some other function: (defun YOUNAMEIT-to-string (program &rest args) "Execute PROGRAM with arguments ARGS and return its output as a string." (with-output-to-string (with-current-buffer standard-output (apply #'process-file program nil t nil args)))) Stefan