From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: split-string behavior change Date: Mon, 25 Feb 2008 11:11:38 +0900 Message-ID: <877igtrdid.fsf@uwakimon.sk.tsukuba.ac.jp> References: <003c01c8774b$48ab7d70$0600a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203905073 31231 80.91.229.12 (25 Feb 2008 02:04:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Feb 2008 02:04:33 +0000 (UTC) Cc: Emacs-Devel To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 25 03:04:58 2008 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 1JTSi9-0006wu-Kw for ged-emacs-devel@m.gmane.org; Mon, 25 Feb 2008 03:04:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTShd-0008QY-Ut for ged-emacs-devel@m.gmane.org; Sun, 24 Feb 2008 21:04:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JTSha-0008Q5-AR for emacs-devel@gnu.org; Sun, 24 Feb 2008 21:04:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JTShV-0008PP-RU for emacs-devel@gnu.org; Sun, 24 Feb 2008 21:04:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTShV-0008PM-Lb for emacs-devel@gnu.org; Sun, 24 Feb 2008 21:04:17 -0500 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JTShV-0001pd-3d for emacs-devel@gnu.org; Sun, 24 Feb 2008 21:04:17 -0500 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id 8CD001535A8; Mon, 25 Feb 2008 11:04:14 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id F3DD21A29E5; Mon, 25 Feb 2008 11:11:38 +0900 (JST) In-Reply-To: <003c01c8774b$48ab7d70$0600a8c0@us.oracle.com> X-Mailer: VM 7.19 under 21.5 (beta28) "fuki" 42711a251efd XEmacs Lucid X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:90332 Archived-At: Drew Adams writes: > I'm not suggesting we change anything now, but I'm curious about the change > in behavior of split-string from Emacs 21 to 22. split-string in Emacs 21 was unable to give appropriate results for (split-string csv ",") where CSV is in comma-separated values format, and has leading or trailing empty fields. That turns out to be a moderately big deal, because it is non-trivial to code this function efficiently and correctly. (At least, that was the motivation I was told for XEmacs not removing nulls at all. Apparently how to parse CSV correctly was a FAQ in some circles.) Also, for several cases it gave different results from XEmacs (including this case). The current behavior is the result of a compromise which preserves the magic behavior of removing empty fields in the one-argument case, uses the simpler behavior of just splitting on the regexp always in the two-argument case, and restores magic behavior in the three argument case with a non-nil third argument.