From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: modern regexes in emacs Date: Mon, 25 Feb 2019 15:47:49 +0100 Message-ID: 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> <83k1i0n88i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="177847"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 25 15:48:23 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 1gyHYJ-000k78-Tr for ged-emacs-devel@m.gmane.org; Mon, 25 Feb 2019 15:48:20 +0100 Original-Received: from localhost ([127.0.0.1]:38550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyHYI-0003Rg-SZ for ged-emacs-devel@m.gmane.org; Mon, 25 Feb 2019 09:48:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyHY7-0003RQ-Rn for emacs-devel@gnu.org; Mon, 25 Feb 2019 09:48:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyHY6-0004r8-T6 for emacs-devel@gnu.org; Mon, 25 Feb 2019 09:48:07 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]:36012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyHY5-0004a0-Ss for emacs-devel@gnu.org; Mon, 25 Feb 2019 09:48:06 -0500 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gyHXp-0005ZI-Rr for emacs-devel@gnu.org; Mon, 25 Feb 2019 15:47:52 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEWWjHIqHhcXDQwjFBEK BwU+OjCwtjanAAACTklEQVQ4jV2US5KjMAyGRae9xxAOEGH2cYB9xzF7m0T3v8r8skl6ZlQpKuiz 3jLERWbIqA/2840jhLg1dJIsplf97EV6BYE4ERmCNAW0Il2M7CKNRgQ/ETIWQNbhBsBMzFccT2pD 87yaNb/gSMF4NUnaVkhEQTIHKLl8ZDVkzlF90a/SK2j+A76P99laP5wouQ/wfT/QzhYyNH8B76Eg syiwQjTeKijvAO4NuILyaluScJyghQvwB6im3sInlzrs29VYQaKOS0uKvp9bU7Lymp/7WCDalVwx yUPKyzt47130zyUGxNvdlZ7cBYCOL3KL9x7nNnmFLlEz5RE9PT9wUAaZ3T3ROW6ENstzJUEHdIrS o7aGLxinAqa0b2VIayJJnW8JE6nA2Do+ynFjFDQkWOx8DFX1Lm7RCsaJegEEK5JyolcAWDwZOMrS MdEJzl1L37pl0af0AftEJqQCQpwEEfIqNwCTyKDZr2KxYRkkbwUcEt+AJE+/4Fn18QceZB8yv8Fe 1BwwSQDJ9gByLmD06QC5FthYV8DDC12NdEisgv0W30D7waUlWAPjuIKwKniOogWihA7JGCmxiOq/ OtobRoc2qCQtXIypwC/qZ0ACk2CUnZU9lBWtoNHCZRU1caFauNJAyB3TF72eajErcI+Ssfd6n9EG 5/R+XHD+oe6CpGUyGOVFPwDMF61tiY/4Y6Z9QnvCuYKHHkacOzWDsI3RxgpQt1Ow0ddkuvjQVfsH tPSFLwYP53gArLOCQPQ9SO5rpxU4fFTwwEbuWANX4vEfI2LGJF6rtggAAAAASUVORK5CYII= In-Reply-To: (Richard Stallman's message of "Sat, 16 Feb 2019 22:17:37 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.231.51 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:233605 Archived-At: Richard Stallman writes: > That's true, of course. But I wonder if some other interface could > make it possible to offer optional use of egrep syntax in a compatible > way that would not break anything. I have not followed this discussion closely, so I'm sorry if I'm repeating points others have made before, but: I think it would be nice if Emacs had a regexp object. That would allow us to extend Emacs in a compatible way somewhat seamlessly over a period of time. We could have a number of different functions that use different regexp syntaxes, but they'd all return a regexp object. For instance, we could have (erx "foo\\|bar") and (pcre "foo|bar") etc, and this would allow us to experiment with different syntaxes more freely. The base Emacs functions that do stuff on regexps have to be adjusted en masse, probably, but there aren't thousands of them -- `re-search-forward' etc -- to take these objects in addition to strings. And: The final endpoint (many years in the future) of all this would be to deprecate the `re-' functions altogether, and allow functions like `search-forward' to take either a string or a regexp object and behave in the obvious fashion... (search-forward (pcre "foo|bar")) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no