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 1224546441 31923 80.91.229.12 (20 Oct 2008 23:47:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Oct 2008 23:47:21 +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:21 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 1Ks3uB-0001Ip-Mi for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Oct 2008 01:11:20 +0200 Original-Received: from localhost ([127.0.0.1]:44684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ks3t6-0004TN-BR for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Oct 2008 19:10:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ks3t3-0004Sw-0B 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 1Ks3t1-0004Sh-Fr for bug-gnu-emacs@gnu.org; Mon, 20 Oct 2008 19:10:08 -0400 Original-Received: from [199.232.76.173] (port=41587 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ks3t1-0004Se-9R for bug-gnu-emacs@gnu.org; Mon, 20 Oct 2008 19:10:07 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:33001) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ks3t0-0005ox-JD for bug-gnu-emacs@gnu.org; Mon, 20 Oct 2008 19:10:07 -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 m9KNA1PQ001301; 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 m9KN042k030774; Mon, 20 Oct 2008 16:00:04 -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:04 +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 1212-submit@emacsbugs.donarmstrong.com id=B1212.122454321729408 (code B ref 1212); Mon, 20 Oct 2008 23:00:04 +0000 Original-Received: (at 1212) by emacsbugs.donarmstrong.com; 20 Oct 2008 22:53:37 +0000 Original-Received: from mtaout2.012.net.il (mtaout2.012.net.il [84.95.2.4]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9KMrXZi029393 for <1212@emacsbugs.donarmstrong.com>; Mon, 20 Oct 2008 15:53:34 -0700 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> for 1212@emacsbugs.donarmstrong.com; Tue, 21 Oct 2008 00:54:55 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-CrossAssassin-Score: 2 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:21718 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