GNU bug report logs - #6384
Teach rx explicitly numbered submatches

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Wed, 9 Jun 2010 17:25:02 UTC

Severity: wishlist

Tags: patch

Merged with 8776

Done: Chong Yidong <cyd <at> stupidchicken.com>

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 6384 in the body.
You can then email your comments to 6384 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6384; Package emacs. (Wed, 09 Jun 2010 17:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 09 Jun 2010 17:25:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: Teach rx explicitly numbered submatches
Date: Wed, 9 Jun 2010 19:22:43 +0200
[Message part 1 (text/plain, inline)]
Explicitly numbered groups are of the form

  \(?nn:...\)

Here is a patch for it. Someone with good lisp fu might check it.
[rx-submatch-n-1.diff (text/x-patch, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6384; Package emacs. (Wed, 09 Jun 2010 18:17:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 6384 <at> debbugs.gnu.org
Subject: Re: bug#6384: Teach rx explicitly numbered submatches
Date: Wed, 09 Jun 2010 14:16:27 -0400
> Explicitly numbered groups are of the form

>   \(?nn:...\)

> Here is a patch for it. Someone with good lisp fu might check it.

I see an elisp file, not  apatch.  Can you resend it as a patch, please?


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6384; Package emacs. (Wed, 09 Jun 2010 18:21:01 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 6384 <at> debbugs.gnu.org
Subject: Re: bug#6384: Teach rx explicitly numbered submatches
Date: Wed, 9 Jun 2010 20:19:52 +0200
[Message part 1 (text/plain, inline)]
On Wed, Jun 9, 2010 at 8:16 PM, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
>> Explicitly numbered groups are of the form
>
>>   \(?nn:...\)
>
>> Here is a patch for it. Someone with good lisp fu might check it.
>
> I see an elisp file, not  apatch.  Can you resend it as a patch, please?

Ah, wrote the wrong buffer ... ;-)

Here it is, it is very small.
[rx-submatch-n-1.diff (text/x-patch, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6384; Package emacs. (Thu, 10 Jun 2010 16:13:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> jurta.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 6384 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#6384: Teach rx explicitly numbered submatches
Date: Thu, 10 Jun 2010 18:51:04 +0300
>      (submatch		. (rx-submatch 1 nil)) ; SRE
> +    (submatch-n		. (rx-submatch-n 2 nil))

I think better would be to allow the existing subform `submatch'
to support numbered groups, i.e. in addition to the current form
`(submatch SEXP1 SEXP2 ...)' also support
`(submatch N SEXP1 SEXP2 ...)' because the number is a parameter
of normal groups.

There are already subforms that support different number of integer
arguments like `(repeat N SEXP)' and `(repeat N M SEXP)'.  So the same
could be done for `submatch' too.

-- 
Juri Linkov
http://www.jurta.org/emacs/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6384; Package emacs. (Thu, 10 Jun 2010 16:28:01 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 6384 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#6384: Teach rx explicitly numbered submatches
Date: Thu, 10 Jun 2010 18:21:36 +0200
On Thu, Jun 10, 2010 at 5:51 PM, Juri Linkov <juri <at> jurta.org> wrote:
>>      (submatch                . (rx-submatch 1 nil)) ; SRE
>> +    (submatch-n              . (rx-submatch-n 2 nil))
>
> I think better would be to allow the existing subform `submatch'
> to support numbered groups, i.e. in addition to the current form
> `(submatch SEXP1 SEXP2 ...)' also support
> `(submatch N SEXP1 SEXP2 ...)' because the number is a parameter
> of normal groups.
>
> There are already subforms that support different number of integer
> arguments like `(repeat N SEXP)' and `(repeat N M SEXP)'.  So the same
> could be done for `submatch' too.


I thought of that, but currently you can do

  (rx (submatch 1 "str"))

Should perhaps 1 etc be disallowed as SEXP:s in rx? (I do not know how
to do it because I believe rx uses `read'.)




Forcibly Merged 6384 8776. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 09 Jul 2011 23:34:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Aug 2011 11:24:18 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 10 days ago.

Previous Next


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