From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.devel Subject: Re: Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification Date: Tue, 9 May 2017 22:09:00 +0900 Message-ID: References: <87vapij1l7.fsf@holos> <6870A2B6-F685-4955-9C0A-256601DB47BC@gmail.com> <51D5E92C-F125-4ADE-8C55-E3513C00ECDC@gmail.com> <8F6958D6-3E13-4C31-B1F8-AF10A8FC8FC6@gmail.com> <838tmafigi.fsf@gnu.org> <7C79DA34-96F2-4D9F-9E9C-01574AE00F12@gmail.com> <8360hefepp.fsf@gnu.org> <0E129E02-FA64-4664-825B-8854A66CA9C6@gmail.com> <3D0BA0E6-02E2-4E90-8A59-121065547E1C@gmail.com> <87ziepho0q.fsf@gnu.org> <83vapderm3.fsf@gnu.org> <87vapdhi9j.fsf@gnu.org> <83tw4xeorf.fsf@gnu.org> <83vapbctij.fsf@gnu.org> <87vapb9dd8.fsf@gnu.org> <877f1qutfq.fsf@drachen> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1494335372 30612 195.159.176.226 (9 May 2017 13:09:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 May 2017 13:09:32 +0000 (UTC) Cc: mvoteiza@udel.edu, Eli Zaretskii , emacs-devel@gnu.org, =?utf-8?Q?Johan_Bockg=C3=A5rd?= , tino.calancha@gmail.com To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 09 15:09:24 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d84tG-0007it-Bn for ged-emacs-devel@m.gmane.org; Tue, 09 May 2017 15:09:22 +0200 Original-Received: from localhost ([::1]:37181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d84tL-0007IW-KC for ged-emacs-devel@m.gmane.org; Tue, 09 May 2017 09:09:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d84tC-0007IG-Oa for emacs-devel@gnu.org; Tue, 09 May 2017 09:09:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d84t9-0007xc-JL for emacs-devel@gnu.org; Tue, 09 May 2017 09:09:18 -0400 Original-Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:35664) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d84sy-0007w6-Mf; Tue, 09 May 2017 09:09:04 -0400 Original-Received: by mail-pg0-x242.google.com with SMTP id i63so15080052pgd.2; Tue, 09 May 2017 06:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ngKnA+jU5IRJ7KSFpmAN6Ry8AjIM9DwUhqwIMTo5XII=; b=mq6Mh6/Xmi38m7c0/GQvFqA8Al8hStqjP2nOemMSDS9GwpGEb6aQ/dpSceu75PUtJL NiYipQAGzJX2OtyLVntI/lcAHkSzKVb55DYYmda3cBWJbwLbZTHU40xyIGdbd7tQt1Ja KZCFn1frjW//lI2gUjZJTSOvqdR2xHjVa+yNwrJHxsWVn4F1hjAzjSKCzhIBRvoM82+K LWkRkhA/HRQ7MNJkGNI59hsssiu/ITqYTeAJJbKPiu/vFvamHExxzopRdQ/PauvJQa9S skotGd/ABB7L8yEgpDakJgSTC+4VYH8lBC9QWfcKMedwgRMvxKVxYyZ8hcfeSnsTH8j8 gbcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ngKnA+jU5IRJ7KSFpmAN6Ry8AjIM9DwUhqwIMTo5XII=; b=b3cu70131G9TlLD9OxY5m8EDPgHrRiI6QKJkUnQgdSRBXAtXHqCuTVvMNFo4GYoKJH CHtuP7snXkVsEfpmFXWVrZHlgmBG3/V/4nzfMndZGBG97ZQCdu0hllExaWcKo19E24M9 xRfZzyUx5EbJzmsIb7C2up0E/CFcmfOP6LWqyrHmCyjn07BeWbVFZh8Vz5aGod9KCJvQ xNftX8EwZtrkb0C0JEzRp29YIp1LMd8pq86MU0Cm7g5Fcn+uqo7HTEl6X3haGMRdoNzJ S7+PX+55UDIXrktmqTcJFvzBjXhf1E4NPF5a2JlixO+SaRzeB6eGfKnY9Q7uTxdOVPqp fRTg== X-Gm-Message-State: AN3rC/6GcfvejmzNw4uF1dc3A25TRM6ebNkHWo/D/S/k89Gf5gbX+Xr4 fjXDYmrTTMmhcw== X-Received: by 10.98.201.197 with SMTP id l66mr29739107pfk.249.1494335343469; Tue, 09 May 2017 06:09:03 -0700 (PDT) Original-Received: from [192.168.24.54] (pl25298.ag0304.nttpc.ne.jp. [133.232.153.210]) by smtp.gmail.com with ESMTPSA id n22sm22235558pfj.27.2017.05.09.06.09.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 06:09:02 -0700 (PDT) In-Reply-To: <877f1qutfq.fsf@drachen> X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214713 Archived-At: > On May 9, 2017, at 21:05, Michael Heerdegen = wrote: >=20 > Jean-Christophe Helary writes: >=20 >>> (split-string "abc, ;def g,hi" nil nil ",\\|;") >>> =3D> >>> ("abc" "def" "g") ; BUG >>=20 >> Ok, and the way to get your result is: >>=20 >> (split-string "abc, ;def g,hi" nil nil "\\(,\\|;\\)") >>=20 >> which means that Emacs thinks it is the caller's duty to provide the >> grouping construct, which also happens to be ugly, and non-intuitive >> since ",\\|;" is an otherwise valid regexp... >>=20 >> So, how do we go about that? Do we report a bug? Or do we find a good >> reason for that to happen and modify the documentation for >> split-string ? >=20 > I'm curious what could be reasons not to fix this (in the code). Because split-string is used all over the place in Emacs and we'd have = to check that the fix is not breaking some code somewhere in ways that = we can't always guess? > Allowing only a subset of possible regexps would be quite strange. Not if you document the strangeness. > Would there be any advantages? Not having to modify a lot of other places in the Emacs code. Jean-Christophe=20=