From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification Date: Tue, 09 May 2017 18:23:36 +0300 Message-ID: <83wp9qawav.fsf@gnu.org> 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1494343478 1966 195.159.176.226 (9 May 2017 15:24:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 May 2017 15:24:38 +0000 (UTC) Cc: mvoteiza@udel.edu, jean.christophe.helary@gmail.com, emacs-devel@gnu.org, bojohan@gnu.org, tino.calancha@gmail.com To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 09 17:24:33 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 1d8703-0000MD-Fx for ged-emacs-devel@m.gmane.org; Tue, 09 May 2017 17:24:31 +0200 Original-Received: from localhost ([::1]:37739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8708-0007L0-R4 for ged-emacs-devel@m.gmane.org; Tue, 09 May 2017 11:24:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d86zb-0007Kf-4n for emacs-devel@gnu.org; Tue, 09 May 2017 11:24:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d86zW-0007OW-Ph for emacs-devel@gnu.org; Tue, 09 May 2017 11:24:03 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d86zW-0007OS-MT; Tue, 09 May 2017 11:23:58 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3248 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d86zV-0006zT-Av; Tue, 09 May 2017 11:23:58 -0400 In-reply-to: <877f1qutfq.fsf@drachen> (message from Michael Heerdegen on Tue, 09 May 2017 14:05:13 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:214717 Archived-At: > From: Michael Heerdegen > Cc: Johan Bockgård , mvoteiza@udel.edu, > Eli Zaretskii , tino.calancha@gmail.com, > emacs-devel@gnu.org > Date: Tue, 09 May 2017 14:05:13 +0200 > > Jean-Christophe Helary writes: > > > > (split-string "abc, ;def g,hi" nil nil ",\\|;") > > > => > > > ("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 ? > > I'm curious what could be reasons not to fix this (in the code). > Allowing only a subset of possible regexps would be quite strange. > Would there be any advantages? How about if we proceed with the change in string-trim, and file a separate bug against both it and split-string, for such regexps? These seem to be largely unrelated issues, and it's a pity to block Jean-Christophe's changes due to that.