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 #86 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andy Moreton <andrewjmoreton <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#36237: Support (rx (and (regexp EXPR) (regexp-quote EXPR)))
Date: Wed, 26 Jun 2019 13:23:53 +0100
On Tue 25 Jun 2019, Noam Postavsky wrote:

> tags 36237 fixed
> close 36237 27.1
> quit
>
>> I'll wait a few more days in case something else comes up.
>
> Pushed to master.
>
> b59ffd2290 2019-06-25T22:00:03-04:00 "Support (rx (and (regexp EXPR) (literal EXPR))) (Bug#36237)"
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=b59ffd2290ff744ca4e7cc2748ba6b66fb2f99f1

With "emacs -Q" from emacs-26:

  (setq foo (rx (group (or "abc" "def"))))
  => "\\(\\(?:abc\\|def\\)\\)"

  (setq bar (rx-to-string `(regexp ,foo)))
  => "\\(?:\\(\\(?:abc\\|def\\)\\)\\)"

  (setq bar (rx (regexp foo)))
  => error "rx form ‘regexp’ requires args satisfying ‘stringp’"

With "emacs -Q from master:

  (setq foo (rx (group (or "abc" "def"))))
  => "\\(\\(?:abc\\|def\\)\\)"

  (setq bar (rx-to-string `(regexp ,foo)))
  => ("\\(?:" "\\)")       ; unexpected result

  (setq bar (rx (regexp foo)))
  => "\\(?:\\(\\(?:abc\\|def\\)\\)\\)"

Please fix this regression.

    AndyM





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.