From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: modern regexes in emacs Date: Fri, 15 Feb 2019 20:40:38 +0000 Message-ID: <20190215204038.GC5438@ACM> References: <83r2c9m8yj.fsf@gnu.org> <17581DA9-7DCA-432E-A2E8-E5184DFA8B4B@acm.org> <20190215114728.0785e891@jabberwock.cb.piermont.com> <20190215175405.GA5438@ACM> <83lg2gnbky.fsf@gnu.org> <20190215191447.GB5438@ACM> <83ftson7nu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="86818"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: mattiase@acm.org, lokedhs@gmail.com, emacs-devel@gnu.org, philippe.vaucher@gmail.com, jaygkamat@gmail.com, perry@piermont.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 15 21:44:11 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gukLA-000MII-LQ for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2019 21:44:08 +0100 Original-Received: from localhost ([127.0.0.1]:46022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gukL9-0001qN-Il for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2019 15:44:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gukL2-0001o5-Tk for emacs-devel@gnu.org; Fri, 15 Feb 2019 15:44:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gukL0-0001P2-21 for emacs-devel@gnu.org; Fri, 15 Feb 2019 15:44:00 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:54437 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1gukKz-0001Mh-EB for emacs-devel@gnu.org; Fri, 15 Feb 2019 15:43:57 -0500 Original-Received: (qmail 96583 invoked by uid 3782); 15 Feb 2019 20:43:52 -0000 Original-Received: from acm.muc.de (p4FE15EA1.dip0.t-ipconnect.de [79.225.94.161]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 15 Feb 2019 21:43:50 +0100 Original-Received: (qmail 21499 invoked by uid 1000); 15 Feb 2019 20:40:38 -0000 Content-Disposition: inline In-Reply-To: <83ftson7nu.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:233399 Archived-At: Hello, Eli. On Fri, Feb 15, 2019 at 22:00:53 +0200, Eli Zaretskii wrote: > > Date: Fri, 15 Feb 2019 19:14:47 +0000 > > Cc: perry@piermont.com, mattiase@acm.org, lokedhs@gmail.com, > > emacs-devel@gnu.org, philippe.vaucher@gmail.com, jaygkamat@gmail.com > > From: Alan Mackenzie > > > > I suggest we retain our current regexp notation, together with compatible > > > > tools, as the sole way of writing regexps in Emacs. This notation is not > > > > all that bad, and it is thoroughly documented and well tested. It's the > > > > approach which will cause the least confusion. It works. > > > I proposed to have a separate set of functions that will accept PCRE > > > syntax. That would allow everyone to have what they want: you to use > > > the "classic" regexps, and those who want PCRE to have that. Where's > > > the problem with that? > > This will end up with a mixture of the two incompatible styles of regexp > > in the Emacs sources. I can see there being such a mixture even within > > single source files. This will be confusing to everybody, particularly > > to beginners. > How is that different from having rx.el? rx.el is fully compatible with standard regexps, and can be viewed as a tool to construct them. > And how is that different from having pcase.el, which invents a whole > new sub-language on top of Lisp? I fear it might not be. I don't think pcase.el was a good addition to Emacs. > Etc. etc. -- that ship has already sailed. No, just because we have several questionable extensions to Emacs Lisp doesn't mean we shouldn't be careful when considering further extensions. > IMO, we'd be silly (let alone look and sound silly) to try to stop > this. The net result will be an unbundled package which everyone will > use, while we bury our heads in the sand. Maybe you're right. But nobody in the thread before me had brought up the disadvantages of the proposal, so I did. To implement a full PCRE inside Emacs Lisp will involve extending it to handle Emacs specific elements (such as \s), and thus closely tying it with syntax.c, etc. "Trying to stop" the proposal may need little more than not actively supporting it. Maybe it won't be as bad as I foresee. There are "but"s, though. -- Alan Mackenzie (Nuremberg, Germany).