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 08:15:23 +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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1494285375 10436 195.159.176.226 (8 May 2017 23:16:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 8 May 2017 23:16:15 +0000 (UTC) Cc: mvoteiza@udel.edu, Eli Zaretskii , tino.calancha@gmail.com, emacs-devel@gnu.org To: =?utf-8?Q?Johan_Bockg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 09 01:16:11 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 1d7rsw-0002aq-1K for ged-emacs-devel@m.gmane.org; Tue, 09 May 2017 01:16:10 +0200 Original-Received: from localhost ([::1]:34099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7rsy-0000Bj-En for ged-emacs-devel@m.gmane.org; Mon, 08 May 2017 19:16:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7rsM-0000Be-NO for emacs-devel@gnu.org; Mon, 08 May 2017 19:15:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7rsL-0002P6-Io for emacs-devel@gnu.org; Mon, 08 May 2017 19:15:34 -0400 Original-Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:34244) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7rsG-0002MU-Ft; Mon, 08 May 2017 19:15:28 -0400 Original-Received: by mail-pg0-x242.google.com with SMTP id u187so12524626pgb.1; Mon, 08 May 2017 16:15:28 -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=uos4l8w7F7sov6ekDySJgEPBgDg0423Tf4dK8FGc7+8=; b=pDuLGuGT6Xruiu77VZYa8s7gGEsREK8DHB/EPWK4j00Bp7yp0uZTvWSK8IXUyn233t MXL6xxEd89qjNBYwbLp6WcYR5ALwY6pEdJ127ZAveoBp8mz3tnd7f6VxJaHMYlLJuxRs YdYc2N7UCbqUoFZfTIWhrlMmvqSyBzkYQU6DZ9+l+K4zaQdIJTQHCver7Z2o5WKT1h2r wpcokESeiBOsrUdJKsxxdG8C0vrtAk02KBCPaN0dTo8+nGmr8Nv5P32AB007oJC+6eDg ZIVlwe/0hA59Z9b+PQUQp1IqSSGBDlpPmIICqi09jBxhJC/cmpyGVB1otvrrGhU1UDmh O4bw== 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=uos4l8w7F7sov6ekDySJgEPBgDg0423Tf4dK8FGc7+8=; b=obZlZ+NxTxknZPqzo7xw2s9bQjeW5/jtyEH2YoGICKDTSyaZTe8ujGVA7DpSob3xfy nH9p8OQXpSCjUQ099xm4355C7qyCu/ToVUd6mL9hWRyE2Rt8EmPmuHGXPgHqYssUe6Rn NhFVldoN18233+AODX3PwB8Xnjx1yQYL4yqil9Yk290UuBySj0j9DI+5sZuoRxORBOgU +ZDuAoQn0XcSJM75AxMVYKHPjQQhrGeemLqCTn1EML7yKE2V58SsPriLB3SXW/feucax Kn0C142i5BfIGT1T0OI1fZuXVN2Rv+B0VZZcQLGgPXEXUq38cjSlOKqoRiucvzxa64w8 oMWg== X-Gm-Message-State: AN3rC/5H/wL//WnRaEW5GzacE/rRSILSEqHrQtg7rw3TQwYubeFCxY7u +yQP/Dozlet/kw== X-Received: by 10.99.117.26 with SMTP id q26mr20954406pgc.21.1494285327407; Mon, 08 May 2017 16:15:27 -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 o124sm24551094pfb.92.2017.05.08.16.15.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 May 2017 16:15:26 -0700 (PDT) In-Reply-To: <87vapb9dd8.fsf@gnu.org> 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:214706 Archived-At: > On May 9, 2017, at 7:45, Johan Bockg=C3=A5rd wrote: >=20 > Jean-Christophe Helary writes: >=20 >>> No, the issue is whether the function should enclose the argument in = a >>> grouping constructs of any kind, or should this be the caller's >>> responsibility when the regexp includes \|. >>=20 >> (split-string) in subr.el (line 3808) doesn't use grouping constructs >> so why do something different than what's already the norm in an >> official emacs lisp file? Doesn't that settle the issue? >=20 > To me, that's nothing other than a bug: >=20 > (split-string "abc, ;def g,hi" nil nil "[,;]") > =3D> > ("abc" "def" "g,hi") >=20 > ;; Should be equivalent! > (split-string "abc, ;def g,hi" nil nil ",\\|;") > =3D> > ("abc" "def" "g") ; BUG Ok, and the way to get your result is: (split-string "abc, ;def g,hi" nil nil "\\(,\\|;\\)") 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... 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 = ? Jean-Christophe=