From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add shell-quasiquote. Date: Wed, 21 Oct 2015 19:19:19 +0300 Message-ID: <83zizcurco.fsf@gnu.org> References: <87si59wj42.fsf@T420.taylan> <878u6znii9.fsf@T420.taylan> <877fmjj9p6.fsf@fencepost.gnu.org> <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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1445444387 20485 80.91.229.3 (21 Oct 2015 16:19:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Oct 2015 16:19:47 +0000 (UTC) Cc: emacs-devel@gnu.org To: Random832 Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 21 18:19:39 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 1Zow6v-00027H-Lt for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 18:19:33 +0200 Original-Received: from localhost ([::1]:52718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zow6v-0005ra-5b for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 12:19:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zow6q-0005r6-QT for emacs-devel@gnu.org; Wed, 21 Oct 2015 12:19:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zow6l-0001Qn-Ro for emacs-devel@gnu.org; Wed, 21 Oct 2015 12:19:28 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:37237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zow6l-0001Pk-KG for emacs-devel@gnu.org; Wed, 21 Oct 2015 12:19:23 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NWK00C00VWPPJ00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Wed, 21 Oct 2015 19:19:22 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NWK00CW5W08AJ80@a-mtaout22.012.net.il>; Wed, 21 Oct 2015 19:19:21 +0300 (IDT) In-reply-to: <87y4ew8fue.fsf@fastmail.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 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:192294 Archived-At: > From: Random832 > Date: Wed, 21 Oct 2015 10:18:49 -0400 > > Eli Zaretskii writes: > >> From: Random832 > >> Strictly speaking, Emacs doesn't *have* an API for "quote for POSIX > >> shells" > > > > Of course it does: it's called "shell-quote-argument". It does > > support Posix shells. > > It doesn't have a documented way for the caller to insist that the > string be quoted for a POSIX shell rather than the user's shell. On what OS would that distinction be important, and why? > In particular, the (undocumented) mechanism that Tramp uses to get > this behavior will obviously break in the presence of (as > recommended by the documentation) an advised or completely > overridden version of the function put in place by a user who has an > unusual shell. Maybe we should mention this subtlety with Tramp in the documentation (I presume you mean the ELisp manual, because the doc string doesn't mention overriding the function). > 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.