From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bug#1212: 23.0.60; split-string-and-unquote problems Date: Tue, 21 Oct 2008 22:04:51 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224641116 17775 80.91.229.12 (22 Oct 2008 02:05:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Oct 2008 02:05:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 22 04:06:17 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KsT6u-0003cb-Mq for ged-emacs-devel@m.gmane.org; Wed, 22 Oct 2008 04:06:09 +0200 Original-Received: from localhost ([127.0.0.1]:56865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsT5o-0003Zw-UJ for ged-emacs-devel@m.gmane.org; Tue, 21 Oct 2008 22:05:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KsT5l-0003Zp-Vk for emacs-devel@gnu.org; Tue, 21 Oct 2008 22:04:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KsT5l-0003Zd-Hz for emacs-devel@gnu.org; Tue, 21 Oct 2008 22:04:57 -0400 Original-Received: from [199.232.76.173] (port=52376 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsT5l-0003Za-Ft for emacs-devel@gnu.org; Tue, 21 Oct 2008 22:04:57 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:33546 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KsT5j-0000MY-S6; Tue, 21 Oct 2008 22:04:56 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8EAKMn/khFxLrB/2dsb2JhbACBcsRFg1CBCg X-IronPort-AV: E=Sophos;i="4.33,460,1220241600"; d="scan'208";a="28691729" Original-Received: from 69-196-186-193.dsl.teksavvy.com (HELO ceviche.home) ([69.196.186.193]) by ironport2-out.teksavvy.com with ESMTP; 21 Oct 2008 22:04:55 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id E3A10B41C1; Tue, 21 Oct 2008 22:04:51 -0400 (EDT) In-Reply-To: (Eli Zaretskii's message of "Tue, 21 Oct 2008 18:05:23 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104806 Archived-At: >> > However, this describes roughly what the code does (which I kinda >> > understood myself by reading it ;-), but does not explain under what >> > circumstances would those functions be useful. By looking at the uses >> > of split-string-and-unquote, I deduced that the intended use is for >> > taking apart shell command lines. If that is not the intent, then >> > what is it? >> >> The intent is for the user to be able to enter in a minibuffer a list of >> strings, where most of them should usually not need any quoting. >> The most common use is to enter a list of arguments to pass to >> a command. Note that "arguments to pass to a command" (even if the >> first element could be the command itself) is not the same as "shell >> command line", since it does not include operators such as |, &, ;, $, >> and `. > Well, in that case my understanding of the intent of these functions > was quite accurate. Which also means that split-string-and-unquote > should, indeed, handle quoting with a backslash and ".." quoting in > the middle of a word, as in `foo" "bar'. Right? No. Just because the arguments are passed to commands doesn't mean they should use sh-style quoting. Proof is, neither csh nor Tcl obey sh-style quoting for the arguments to commands they run. The list of strings will be passed to call-process or start-process which ultimately will pass them to execv or somesuch: no shell in sight. Stefan