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: Thu, 22 Oct 2015 15:53:27 +0200 Message-ID: <87y4evvwko.fsf@fencepost.gnu.org> References: <87si59wj42.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> <87k2qgw3q1.fsf@fastmail.com> <83lhawuny4.fsf@gnu.org> <8737x4vyyg.fsf@fastmail.com> <83bnbsujqd.fsf@gnu.org> <87y4ewujf8.fsf@fastmail.com> <837fmguixu.fsf@gnu.org> <87twpkhugn.fsf@fastmail.com> <8337x3vd8d.fsf@gnu.org> <871tcnz8or.fsf@fencepost.gnu.org> <87611zuikf.fsf@fastmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445522045 25401 80.91.229.3 (22 Oct 2015 13:54:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Oct 2015 13:54:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Random832 Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 22 15:54:02 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 1ZpGJW-0007pP-Mk for ged-emacs-devel@m.gmane.org; Thu, 22 Oct 2015 15:53:54 +0200 Original-Received: from localhost ([::1]:60107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpGJW-00021r-7b for ged-emacs-devel@m.gmane.org; Thu, 22 Oct 2015 09:53:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpGJE-00021Z-Oc for emacs-devel@gnu.org; Thu, 22 Oct 2015 09:53:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpGJD-0005HP-Dh for emacs-devel@gnu.org; Thu, 22 Oct 2015 09:53:36 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpGJ6-0005CZ-2y; Thu, 22 Oct 2015 09:53:28 -0400 Original-Received: from localhost ([127.0.0.1]:45267 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZpGJ5-0002iM-I7; Thu, 22 Oct 2015 09:53:27 -0400 Original-Received: by lola (Postfix, from userid 1000) id 193CCDF4B4; Thu, 22 Oct 2015 15:53:27 +0200 (CEST) In-Reply-To: <87611zuikf.fsf@fastmail.com> (Random's message of "Thu, 22 Oct 2015 09:41:20 -0400") 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:192386 Archived-At: Random832 writes: > David Kastrup writes: >> Eli Zaretskii writes: >>> OK, but that still boils down to binding some more variables. If we >>> want to help users with these factoids, we could have a small database >>> of the known Posix shells and their requirements. > > I couldn't find an easy way to do let-style binding of environment > variables, though I didn't look very hard. And the point of what I was > suggesting is to let *packages* do this, not *users*, so the "database" > would have to be part of code that decides what to actually do. > >> I think that's overdoing it with regard to shell-quote-argument and >> friends. We don't need a full POSIX shell, just something with the most >> basic quoting conventions of it. /bin/sh should be fine here. > > I think there might be a basic miscommunication here. If you don't > care about being able to execute arbitrary POSIX shell commands as > well as is possible on a given system, what's even the point of > *having* functions like shell-quote-argument, shell-command, etc, > instead of call-process? Executing _basic_ POSIX shell commands with arbitrary correctly quoted arguments? "arbitrary POSIX shell commands" is just too ambitious of a goal. Please read or M-x (info "(autoconf) Portable Shell") for an overview of the terror awaiting you. > In these discussions I've been starting from the assumption that these > functions actually have a point and that being able to execute complex > shell commands (which may use advanced redirection, if/case/for/etc, > parameter expansion, and so forth) from within elisp scripts is a > desirable feature. This bears absolutely no relation to shell-quote-argument as shell-quote-argument has only a very small well-described job. >> That's all the guarantee you get for calling commands/scripts with >> `system'. I don't think we should require more than that or try >> providing some guarantees in that regard. > > On an actual POSIX system, it's guaranteed that "sh" from PATH (not > necessarily /bin/sh) will be a POSIX shell, and that 'system' will > execute it and not some other shell. (AIUI this is generally still > implemented by a hardcoded path, just one which is not necessarily > /bin/sh) Except that "actual POSIX systems" don't actually exist a whole lot. It's all approximations. And it's totally irrelevant regarding the job shell-quote-argument has to do. -- David Kastrup