GNU bug report logs -
#34100
26.1; Incomplete ? and ?? handling in rx
Previous Next
Reported by: Mattias Engdegård <mattiase <at> acm.org>
Date: Wed, 16 Jan 2019 11:41:01 UTC
Severity: normal
Found in version 26.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34100 in the body.
You can then email your comments to 34100 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34100
; Package
emacs
.
(Wed, 16 Jan 2019 11:41:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Mattias Engdegård <mattiase <at> acm.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 16 Jan 2019 11:41:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In rx, the ? and ?? operators can be written verbatim as ? and ?? (space and ? character), or by using symbols whose leading character needs to be escaped, \? and \?? respectively. The names come from Olin Shivers's SRE, but ? is not a special character in Scheme syntax, hence the character syntax hack.
However, the symbols only partially work:
(rx (\? "x") (\?? "y")) --> "x?y?" ; expected "x?y??"
(rx (minimal-match (\? "x"))) --> "x??" ; expected "x?"
While it could be argued that only the character-based syntax should be used, the fact is that the symbols are accepted and seem to work, just in a subtly broken way.
The documentation is also not clear on this point, and a programmer knowing the elisp syntax might very well assume that the symbols are the ones to use.
Suggested fix:
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index a39fe55c32..8b4551d0d3 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -733,8 +733,8 @@
is non-nil."
(rx-check form)
(setq form (rx-trans-forms form))
- (let ((suffix (cond ((memq (car form) '(* + ?\s)) "")
- ((memq (car form) '(*? +? ??)) "?")
+ (let ((suffix (cond ((memq (car form) '(* + \? ?\s)) "")
+ ((memq (car form) '(*? +? \?? ??)) "?")
(rx-greedy-flag "")
(t "?")))
(op (cond ((memq (car form) '(* *? 0+ zero-or-more)) "*")
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34100
; Package
emacs
.
(Wed, 16 Jan 2019 14:07:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 34100 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Here is a patch with a test.
[0001-Make-the-rx-operators-and-behave-correctly.patch (application/octet-stream, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34100
; Package
emacs
.
(Fri, 25 Jan 2019 10:10:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 34100 <at> debbugs.gnu.org (full text, mbox):
Anything more I can do? I thought this one would be rather straightforward.
I do understand that there are more pressing matters.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34100
; Package
emacs
.
(Mon, 28 Jan 2019 15:54:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 34100 <at> debbugs.gnu.org (full text, mbox):
Mattias Engdegård <mattiase <at> acm.org> writes:
> Anything more I can do? I thought this one would be rather
> straightforward. I do understand that there are more pressing
> matters.
I guess you just have to be patient until someone has a look. That can
sometimes take some time, there are a lot of open bug reports...
For me what you suggest looks like a good idea btw.
Michael.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Fri, 01 Feb 2019 09:45:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Mattias Engdegård <mattiase <at> acm.org>
:
bug acknowledged by developer.
(Fri, 01 Feb 2019 09:45:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 34100-done <at> debbugs.gnu.org (full text, mbox):
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Date: Mon, 28 Jan 2019 16:53:28 +0100
> Cc: 34100 <at> debbugs.gnu.org
>
> Mattias Engdegård <mattiase <at> acm.org> writes:
>
> > Anything more I can do? I thought this one would be rather
> > straightforward. I do understand that there are more pressing
> > matters.
>
> I guess you just have to be patient until someone has a look. That can
> sometimes take some time, there are a lot of open bug reports...
>
> For me what you suggest looks like a good idea btw.
Sorry for the long delay, Mattias. I've now pushed your changes to
the master branch, and I'm marking this bug done.
Thanks.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 01 Mar 2019 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 6 years and 172 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.