From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: modern regexes in emacs Date: Sun, 17 Feb 2019 22:01:45 +0200 Organization: LINKOV.NET Message-ID: <8736om2q92.fsf@mail.linkov.net> References: <20180616123704.7123f6d7@jabberwock.cb.piermont.com> <87po0qs6re.fsf@gmail.com> <83r2c9m8yj.fsf@gnu.org> <17581DA9-7DCA-432E-A2E8-E5184DFA8B4B@acm.org> <20190215114728.0785e891@jabberwock.cb.piermont.com> <20190215175405.GA5438@ACM> <83lg2gnbky.fsf@gnu.org> <3D5EA6AB-F0DA-4B66-8592-A111C906B3AE@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="38307"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Elias =?iso-8859-1?Q?M=E5rtenson?= , perry@piermont.com, philippe.vaucher@gmail.com, jaygkamat@gmail.com, Alan Mackenzie , Eli Zaretskii , 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 Sun Feb 17 22:09:06 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 1gvTgP-0009ps-ND for ged-emacs-devel@m.gmane.org; Sun, 17 Feb 2019 22:09:06 +0100 Original-Received: from localhost ([127.0.0.1]:46649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvTgO-0000sI-MQ for ged-emacs-devel@m.gmane.org; Sun, 17 Feb 2019 16:09:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvTgH-0000s1-Gm for emacs-devel@gnu.org; Sun, 17 Feb 2019 16:08:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvTgG-0001XK-IY for emacs-devel@gnu.org; Sun, 17 Feb 2019 16:08:57 -0500 Original-Received: from lavender.maple.relay.mailchannels.net ([23.83.214.99]:63539) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvTgE-0001UQ-R8; Sun, 17 Feb 2019 16:08:55 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 236F55C49F1; Sun, 17 Feb 2019 21:08:47 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a11.g.dreamhost.com (unknown [100.96.36.160]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 92DE05C4981; Sun, 17 Feb 2019 21:08:46 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a11.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sun, 17 Feb 2019 21:08:47 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Spot-Dime: 41679791267c8bd0_1550437726946_2374026028 X-MC-Loop-Signature: 1550437726946:4151820737 X-MC-Ingress-Time: 1550437726945 Original-Received: from pdx1-sub0-mail-a11.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a11.g.dreamhost.com (Postfix) with ESMTP id 36C11820F7; Sun, 17 Feb 2019 13:08:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=BuXswt DGPpE8w6tU56dKKiySVdo=; b=e1+5P86PtaQYrhrLw7e1TznIt91cuw8D4z9iMW 0jwFlRf0dSMBq7SFqH4i7y4ckFSZBDOA5yi1/oXuTO8KjxO1QpXDiI2bDcNnVyim I1Av+/SOaBr9Gwq7I6oUeMJbGTn0eGUnsiyjvqtYWyh1+rUXDhOCvi09j7Sf2qy4 SVp1c= Original-Received: from mail.jurta.org (m91-129-107-100.cust.tele2.ee [91.129.107.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a11.g.dreamhost.com (Postfix) with ESMTPSA id 25D618211A; Sun, 17 Feb 2019 13:08:40 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a11 In-Reply-To: <3D5EA6AB-F0DA-4B66-8592-A111C906B3AE@acm.org> ("Mattias \=\?iso-8859-1\?Q\?Engdeg\=E5rd\=22's\?\= message of "Fri, 15 Feb 2019 19:43:15 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrudduuddgudegiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucffohhmrghinheprhgvghhulhgrrhdqvgigphhrvghsshhiohhnshdrihhnfhhonecukfhppeeluddruddvledruddtjedruddttdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdejrddutddtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepmhgrthhtihgrshgvsegrtghmrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.99 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:233436 Archived-At: > If I read the petitioners correctly, they want a global setting that > permits them to type a(b|c) instead of a\(b\|c\) in isearch-forward-reg= exp > and all other interactive commands. This would be really trivial to do when we'll have a function that will convert an extended regexp string into rx form like what the xr package does, i.e. like the function =E2=80=98xr=E2=80=99, a new f= unction =E2=80=98exr=E2=80=99 could convert an extended regexp - as opposed to ba= sic regexp as noted in https://www.regular-expressions.info/gnu.html Then similarly to =E2=80=98isearch-symbol-regexp=E2=80=99, the implementa= tion will be just 4 lines: (isearch-define-mode-toggle extended "\\" isearch-extended-regexp "\ Turning on extended regexp search turns off basic regexp mode.") (defun isearch-extended-regexp (string) (rx (exr string))) that will also automatically support extended regexp interactively in occur, query-replace-regexp...