From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add shell-quasiquote. Date: Wed, 21 Oct 2015 18:37:16 +0200 Message-ID: <87lhawi3er.fsf@fencepost.gnu.org> References: <87si59wj42.fsf@T420.taylan> <87zizfm2dq.fsf@T420.taylan> <871tcr7yvq.fsf@fastmail.com> <87mvvfm0bd.fsf@T420.taylan> <56250803.5080601@cs.ucla.edu> <87a8ren5ys.fsf@T420.taylan> <56259BB1.3070908@cs.ucla.edu> <878u6ykmvt.fsf@T420.taylan> <87h9llvo98.fsf@members.fsf.org> <5626622A.3090707@yandex.ru> <87zizdijbp.fsf@T420.taylan> <56267302.7050606@yandex.ru> <87io61igyu.fsf@T420.taylan> <56267CDF.6010201@yandex.ru> <87wpuhh15s.fsf@T420.taylan> <562683B9.1060305@yandex.ru> <83y4exe71v.fsf@gnu.org> <87y4ewoqbs.fsf@fastmail.com> <83si54e2qx.fsf@gnu.org> <87y4ew8fue.fsf@fastmail.com> <83zizcurco.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445445463 9634 80.91.229.3 (21 Oct 2015 16:37:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Oct 2015 16:37:43 +0000 (UTC) Cc: Random832 , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 21 18:37:37 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZowOP-0003zG-7A for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 18:37:37 +0200 Original-Received: from localhost ([::1]:52823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZowOO-00059J-IQ for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 12:37:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZowOE-00051e-NS for emacs-devel@gnu.org; Wed, 21 Oct 2015 12:37:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZowOD-0007Gj-Je for emacs-devel@gnu.org; Wed, 21 Oct 2015 12:37:26 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZowO6-0007Ct-Ln; Wed, 21 Oct 2015 12:37:18 -0400 Original-Received: from localhost ([127.0.0.1]:55468 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZowO4-0004XT-So; Wed, 21 Oct 2015 12:37:17 -0400 Original-Received: by lola (Postfix, from userid 1000) id 74900F2DB8; Wed, 21 Oct 2015 18:37:16 +0200 (CEST) In-Reply-To: <83zizcurco.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 21 Oct 2015 19:19:19 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192298 Archived-At: Eli Zaretskii writes: > From: Random832 >> Maybe what needs to be done is to have separate functions >> shell-quote-argument-msdos, shell-quote-argument-nt, >> shell-quote-argument-posix, and then have shell-quote-argument call >> those based on the user's shell. > > I don't think anyone asked for exposing these internals. I also have > trouble imagining situations when a user on a non-Posix platform would > need to call these functions directly: most users on those platforms > aren't even aware we go through cmdproxy, and only futz with with > their shell when they want the Cygwin Bash to be it, a situation Emacs > detects automatically. > > But I won't object to this suggestion, if someone sends patches. I'd > be interested to hear from others, though. I don't think package authors as a rule _ever_ bother a lot about what kind of shell might run their commands. Most external utilities and Free Software programs of some relevance, including but not restricted to GNU utilities, are available on a wide variety of both UNIX-like and unalike systems. More often than not shell-quote-argument will be used _exactly_ in order to save the package author from having to bother about the actual shell in question. The best way to do that would be a quoting strategy that works on all systems, the next best autodetection, possibly with some optionable aid when the system in question is not necessary the local one (I think we had some expedient for executing helper commands like decompressors remotely but currently can't find anything. At any rate, specifying a local cwd for expanding a shell argument suitable for execution in the target location or let-binding default-directory suitably around the call of shell-quote-argument might be appropriate, though the latter, not being expected behavior for shell-quote-argument currently, might be problematic). At any rate, I'm afraid that providing _separate_ shell-quote-argument functions will encourage people to create programs that stop working when tramping/communicating/ftping/whatever to a system of different kind. -- David Kastrup