GNU bug report logs - #36237
Support (rx (and (regexp EXPR) (regexp-quote EXPR)))

Previous Next

Package: emacs;

Reported by: Noam Postavsky <npostavs <at> gmail.com>

Date: Sat, 15 Jun 2019 23:44:02 UTC

Severity: wishlist

Tags: fixed, patch

Merged with 6985

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 36237 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>,
 Mattias EngdegÄrd <mattiase <at> acm.org>,
 36237 <at> debbugs.gnu.org, kevin.legouguec <at> gmail.com
Subject: Re: bug#36237: Support (rx (and (regexp EXPR) (regexp-quote EXPR)))
Date: Sun, 16 Jun 2019 08:35:01 -0400
> 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





This bug report was last modified 5 years and 326 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.