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#1212: 23.0.60; split-string-and-unquote problems Date: Tue, 21 Oct 2008 00:53:30 +0200 Message-ID: References: Reply-To: Eli Zaretskii , 1212@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1224546438 31906 80.91.229.12 (20 Oct 2008 23:47:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Oct 2008 23:47:18 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, 1212@emacsbugs.donarmstrong.com, emacs-devel@gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 21 01:48:16 2008 connect(): Connection refused 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.50) id 1Ks3uK-0001OQ-S1 for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Oct 2008 01:11:29 +0200 Original-Received: from localhost ([127.0.0.1]:44770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ks3tF-0004XA-EC for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Oct 2008 19:10:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ks3t3-0004T8-CQ for bug-gnu-emacs@gnu.org; Mon, 20 Oct 2008 19:10:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ks3t0-0004SV-Cv for bug-gnu-emacs@gnu.org; Mon, 20 Oct 2008 19:10:08 -0400 Original-Received: from [199.232.76.173] (port=41586 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ks3t0-0004SS-6G for bug-gnu-emacs@gnu.org; Mon, 20 Oct 2008 19:10:06 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:33000) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ks3sz-0005of-IN for bug-gnu-emacs@gnu.org; Mon, 20 Oct 2008 19:10:06 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9KNA1PS001301; Mon, 20 Oct 2008 16:10:01 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m9KN03la030670; Mon, 20 Oct 2008 16:00:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Eli Zaretskii Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 20 Oct 2008 23:00:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1212 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122454321529402 (code B ref -1); Mon, 20 Oct 2008 23:00:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 20 Oct 2008 22:53:35 +0000 Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9KMrU5o029394 for ; Mon, 20 Oct 2008 15:53:31 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:54256) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Ks3aN-0006DZ-24 for emacs-pretest-bug@gnu.org; Mon, 20 Oct 2008 18:50:51 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ks3cv-0003vh-7r for emacs-pretest-bug@gnu.org; Mon, 20 Oct 2008 18:53:29 -0400 Original-Received: from mtaout2.012.net.il ([84.95.2.4]:31597) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ks3cu-0003vZ-RD; Mon, 20 Oct 2008 18:53:29 -0400 Original-Received: from HOME-C4E4A596F7 ([77.126.98.197]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K9200MZ47NIHU20@i_mtaout2.012.net.il>; Tue, 21 Oct 2008 00:54:55 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 20 Oct 2008 19:10:08 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:21717 Archived-At: > From: Andreas Schwab > Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org > Date: Mon, 20 Oct 2008 23:28:21 +0200 > > Eli Zaretskii writes: > > >> From: Andreas Schwab > >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org > >> Date: Mon, 20 Oct 2008 19:08:35 +0200 > >> > >> Why do you think that "Emacs Lisp quoting" has anything to do with > >> "shell command quoting"? > > > > Because I grep'ped Emacs sources for its users. > > That does not make it more suitable. You know, since you evidently know better, how about if you explained what that pair of functions is supposed to do, exactly, and what are their intended uses? The doc strings fall short by a large margin, and NEWS had this to say about these functions: *** `split-string-and-unquote' does (what?) *** `combine-and-quote-strings' does (what?) If I can understand the explanation, maybe I could produce from it a suitable section of the ELisp manual, which is the reason why I started to play with split-string-and-unquote. Failing that, I will stick to my interpretation. Here's what I wrote in the ELisp manual about these two functions; comments and corrections, if someone has them, are greatly appreciated: @cindex quoting and unquoting shell command line The following two functions help creating shell commands from individual argument strings and taking shell command lines apart into individual arguments. @defun split-string-and-unquote string &optional separators This function splits @var{string} into substrings at matches for the regular expression @var{separators}, like @code{split-string} does (@pxref{Creating Strings}), but it additionally removes quoting from the substrings. It then makes a list of the substrings and returns it. If @var{separators} is omitted or nil, it defaults to @code{"\\s-+"}, which is a regular expression that matches one or more characters with whitespace syntax (@pxref{Syntax Class Table}). The quoting this function supports is of 2 styles: by enclosing a whole string in double quotes @code{"@dots{}"}, or by quoting individual characters with a backslash escape @samp{\}. The latter is also used in Lisp strings, so this function can handle those as well. @end defun @defun combine-and-quote-strings list-of-strings &optional separator This function concatenates @var{list-of-strings} into a single string, quoting each string in the list that needs quoting as it goes. It also sticks the @var{separator} string in between each pair of strings in the result, and returns that result. If @var{separator} is omitted or @code{nil}, it defaults to a blank @code{" "}. The strings in @var{list-of-strings} that need quoting are those that include @var{separator} as their substring. Quoting a string encloses it in double quotes @code{"@dots{}"}. In the simplest case, if you are consing a shell command from the individual command-line arguments, every argument that includes embedded blanks will be quoted. @end defun