From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#7563: 23.2; `split-string-and-unquote' mis-documented / purpose unclear Date: Sat, 11 Dec 2010 11:50:35 +0200 Message-ID: <83fwu4vdsk.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1292061167 6631 80.91.229.12 (11 Dec 2010 09:52:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Dec 2010 09:52:47 +0000 (UTC) Cc: 7563-done@debbugs.gnu.org, 1212-done@debbugs.gnu.org To: Dave Abrahams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 11 10:52:42 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PRM8A-0001hh-97 for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Dec 2010 10:52:42 +0100 Original-Received: from localhost ([127.0.0.1]:44158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PRM89-0003so-Iw for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Dec 2010 04:52:41 -0500 Original-Received: from [140.186.70.92] (port=38367 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PRM7p-0003rl-MP for bug-gnu-emacs@gnu.org; Sat, 11 Dec 2010 04:52:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PRM7o-0000Ec-4O for bug-gnu-emacs@gnu.org; Sat, 11 Dec 2010 04:52:21 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PRM7n-0000EY-Uu for bug-gnu-emacs@gnu.org; Sat, 11 Dec 2010 04:52:20 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PRM0l-0001x0-LU for bug-gnu-emacs@gnu.org; Sat, 11 Dec 2010 04:45:03 -0500 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Dec 2010 09:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 7563 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 7563@debbugs.gnu.org, eliz@gnu.org Original-Received: via spool by 7563-done@debbugs.gnu.org id=D7563.12920606657428 (code D ref 7563); Sat, 11 Dec 2010 09:45:03 +0000 Original-Received: (at 7563-done) by debbugs.gnu.org; 11 Dec 2010 09:44:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRM07-0001vh-U8 for submit@debbugs.gnu.org; Sat, 11 Dec 2010 04:44:24 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRM04-0001vN-8E; Sat, 11 Dec 2010 04:44:21 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LD900J00CBP3V00@a-mtaout21.012.net.il>; Sat, 11 Dec 2010 11:50:23 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.142.197]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LD900IM1CNWXB80@a-mtaout21.012.net.il>; Sat, 11 Dec 2010 11:50:22 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 11 Dec 2010 04:45:03 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:42416 Archived-At: > Date: Sun, 05 Dec 2010 16:28:16 -0500 > From: Dave Abrahams > Cc: > > This function performs two types of quoting: enclosing a whole > string in double quotes `"..."', and quoting individual characters > with a backslash escape `\'. The latter is also used in Lisp > strings, so this function can handle those as well. > > > First problem: the last paragraph above is simply wrong. > split-string-and-unquote doesn't perform any type of quoting; it > un-quotes. I changed "performs" to "supports". Thanks for catching this. > Second problem: the doc implies that a string that could be executed > by the shell could be split into its constituent arguments by > split-string-and-unquote, but in general, it cannot, e.g.: > > (split-string-and-unquote "'foo bar'") => ("'foo" "bar'") > (split-string-and-unquote "foo\\ bar") => ("foo" "bar") > > I'm not sure what this function is really supposed to be for, but any > implication that it properly handles conversion into shell arguments > is highly misleading. Some motivation should be given for proper use > of split-string-and-unquote, or it should be deprecated. This has come up before; see Bug #1212 and this thread: http://lists.gnu.org/archive/html/emacs-devel/2008-10/msg00431.html The best explanation I can give you is that this function is for taking minibuffer input and converting it to a list of string arguments as required by call-process and start-process. (I added this information to the manual.) Note that the documentation does not mention "shell" anywhere. You could also gain some insight by looking at the users of this function. With those changes, I'm closing this bug report (and 1212 as well), because the issue has been already beaten to death in the above discussion. The changes I made are on the emacs-23 branch, btw, in case you want to eyeball them.