From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Perry E. Metzger" Newsgroups: gmane.emacs.devel Subject: Re: modern regexes in emacs Date: Fri, 15 Feb 2019 11:47:28 -0500 Message-ID: <20190215114728.0785e891@jabberwock.cb.piermont.com> References: <20180616123704.7123f6d7@jabberwock.cb.piermont.com> <87po0qs6re.fsf@gmail.com> <83r2c9m8yj.fsf@gnu.org> <17581DA9-7DCA-432E-A2E8-E5184DFA8B4B@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="202608"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eli Zaretskii , jaygkamat@gmail.com, lokedhs@gmail.com, Philippe Vaucher , emacs-devel@gnu.org To: Mattias =?ISO-8859-1?Q?Engdeg=E5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 15 17:47:40 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 1gugeK-000qXF-5i for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2019 17:47:40 +0100 Original-Received: from localhost ([127.0.0.1]:42913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gugeJ-0006h3-0n for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2019 11:47:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gugeD-0006gw-CS for emacs-devel@gnu.org; Fri, 15 Feb 2019 11:47:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gugeB-00075W-Sc for emacs-devel@gnu.org; Fri, 15 Feb 2019 11:47:32 -0500 Original-Received: from hacklheber.piermont.com ([166.84.7.14]:54650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gugeA-00073S-RB; Fri, 15 Feb 2019 11:47:30 -0500 Original-Received: from snark.cb.piermont.com (localhost [127.0.0.1]) by hacklheber.piermont.com (Postfix) with ESMTP id BAF11F2; Fri, 15 Feb 2019 11:47:28 -0500 (EST) Original-Received: from jabberwock.cb.piermont.com (jabberwock.cb.piermont.com [10.160.2.107]) by snark.cb.piermont.com (Postfix) with ESMTP id 977D13C2001; Fri, 15 Feb 2019 11:47:28 -0500 (EST) In-Reply-To: <17581DA9-7DCA-432E-A2E8-E5184DFA8B4B@acm.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 166.84.7.14 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:233385 Archived-At: On Fri, 15 Feb 2019 17:24:18 +0100 Mattias Engdeg=C3=A5rd wrote: > 15 feb. 2019 kl. 15.18 skrev Eli Zaretskii : > >=20 > > It should be possible if we introduce new functions for PCRE, or > > if we mark PCRE regexps in some special way, like put a special > > text property on the string. =20 >=20 > It would be easier if those who ask for PCRE would say exactly what > they want: >=20 > (1) The syntax of PCRE -- | () {} instead of \| \(\) \{\} etc -- > but restricted to the set of features of the Emacs regexp engine. Modern syntax is the main one. > (2) The features of PCRE not present in Emacs regexps. Which ones, > exactly? Lookbehind assertions? Atomic groups? I'm not particularly interested in those. > (3) PCRE for interactive use only. > (4) PCRE for general Elisp programming.=20 The old style syntax is repulsive. I think we should make it possible to slowly switch over to the syntax everyone using regexps has gotten used to over the last 30 years or so. BREs in the style Emacs has been using have been obsolete for longer than many Emacs users have been alive. > Locating and wrapping the places that ask for regexps > interactively, such as `query-replace-regexp', would permit the > interactive regexp syntax to become a simple user customisation -- > traditional, PCRE, rx or whatnot. It would be a matter of writing a > transformation function, and possibly some syntax highlighting, for > each case. >=20 > I wouldn't be surprised if 99% of the requests are really about not > having to escape |(){} as metacharacters in interactive use. No, that's a lot of my complaint. I can't even remember what the correct syntax is half the time. Anyway, I recommend Eli's approach. We create a parallel set of modernized syntax functions, and people can slowly adopt them. Perry --=20 Perry E. Metzger perry@piermont.com