From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#36237: Support (rx (and (regexp EXPR) (regexp-quote EXPR))) Date: Sun, 16 Jun 2019 08:35:01 -0400 Message-ID: References: <87fto9yawl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="54867"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Michael Heerdegen , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 36237@debbugs.gnu.org, kevin.legouguec@gmail.com To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 16 14:36:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcUOK-000E4P-2q for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Jun 2019 14:36:12 +0200 Original-Received: from localhost ([::1]:39428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcUOJ-0002fm-2t for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Jun 2019 08:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41632) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcUOC-0002dU-SS for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 08:36:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcUOB-00042G-So for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 08:36:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54627) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcUO9-00040X-Qr for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 08:36:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hcUO9-0003fN-LY for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 08:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Jun 2019 12:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36237 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36237-submit@debbugs.gnu.org id=B36237.156068851714037 (code B ref 36237); Sun, 16 Jun 2019 12:36:01 +0000 Original-Received: (at 36237) by debbugs.gnu.org; 16 Jun 2019 12:35:17 +0000 Original-Received: from localhost ([127.0.0.1]:39938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcUNR-0003eL-0Q for submit@debbugs.gnu.org; Sun, 16 Jun 2019 08:35:17 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55355) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcUNK-0003dz-LA for 36237@debbugs.gnu.org; Sun, 16 Jun 2019 08:35:15 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E36E6100C30; Sun, 16 Jun 2019 08:35:04 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C881F100A32; Sun, 16 Jun 2019 08:35:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1560688503; bh=RgsX4Kkl/mGesuqEjZUOGZsdXHCJFNSpo7rDt36tbj4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=fPSpIM2Q+8lvI29KPVutGnIR8fNQc1Vin+t0GJ0koo2ZWB7RCHk+8lCzVBK+N6k2F uLCWTs7ig3ca6zJ/ujnGRM9o4uYea3i9Cc/1Q+58DV+mDGs49V7CUzGY0zKnx4HG6k 0XulCigYoxuoyyOGR9DFGLnsQnXya9wCB3OW2lTmK9GdcE8GUMMloSXLRhzWj9Y4yR h7svdQ/l3qfZkcOtH/D2oYCI6GevJ6s+dcb3K6pCw0f2mKaJkspARNbsZcC+T44KvU CV+ew044c/b05nDwMI5PYh23dgsRfVstAwbvJBDE4z9WojmDiyf4G2/YO8dixoI1h0 2dHlFtP3UVY2Q== Original-Received: from pastel (unknown [157.52.10.58]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 89AA812036E; Sun, 16 Jun 2019 08:35:03 -0400 (EDT) In-Reply-To: <87fto9yawl.fsf@gmail.com> (Noam Postavsky's message of "Sun, 16 Jun 2019 08:25:46 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160666 Archived-At: > I'm not sure that it is, e.g., python-rx might bind it too (if it > weren't for the fact that python.el needs to maintain backwards > compatibility with older Emacs). I think that would still be "python-rx using internals of rx". And that could be fixed if we can rewrite it with rx-macrolet, right? > regexp does exactly what it did before, i.e., it accepts only a constant > string. Likewise regexp-quote accepts only a constant string, which > makes it pointless to use in rx-to-string (just use a plain STRING > directly), but I didn't disallow it. Good, thanks. >>> - What is now the correct way of including a compile-time regexp expression, >>> such as a defconst? (regexp (eval-when-compile EXPR))? Still a mouthful, but >>> perhaps outside the scope of this bug. > Oh, hmm. That might be a reason to keep using `eval'. It could make people reluctant to change, yes, but that still wouldn't be a valid reason in my book. >> FWIW, I have the impression that in most cases where this could be >> useful, a better solution would be to provide something like >> `rx-defmacro` and/or `rx-macrolet`. > I guess that could replace the "old crusty" rx-constituents thing too. That's the idea, yes. Stefan