GNU bug report logs - #50845
Color capturing groups in query replace regexp

Previous Next

Package: emacs;

Reported by: ndame <laszlomail <at> protonmail.com>

Date: Mon, 27 Sep 2021 12:56:02 UTC

Severity: normal

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 50845 in the body.
You can then email your comments to 50845 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 bug-gnu-emacs <at> gnu.org:
bug#50845; Package emacs. (Mon, 27 Sep 2021 12:56:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ndame <laszlomail <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 27 Sep 2021 12:56:02 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: Color capturing groups in query replace regexp
Date: Mon, 27 Sep 2021 12:54:45 +0000
When doing some complex capturing and replacing it could be helpful to see what each of the groups captured.

So instead of coloring the match with a single color when query replacing, the part captured by the first parens
has one color, the second capturing group a different color, etc. and after replacing if the user used a
comma to replace but not move point to the next match, the same colors indicate the replacement texts for the
corresponding groups.

And the matching parts outside of parens can have the same face which qrr currently uses.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50845; Package emacs. (Mon, 27 Sep 2021 13:04:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 50845 <at> debbugs.gnu.org
Cc: ndame <laszlomail <at> protonmail.com>
Subject: Re: bug#50845: Color capturing groups in query replace regexp
Date: Mon, 27 Sep 2021 15:03:16 +0200
ndame via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> When doing some complex capturing and replacing it could be helpful to
> see what each of the groups captured.

You don't say what Emacs version you're reporting this for, but in Emacs
28, the `isearch-group-2' and `isearch-group-1' faces are used for
this.  (That is, it's even/odd group matches.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50845; Package emacs. (Mon, 27 Sep 2021 13:13:02 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50845 <at> debbugs.gnu.org
Subject: Re: bug#50845: Color capturing groups in query replace regexp
Date: Mon, 27 Sep 2021 13:12:37 +0000
>
> You don't say what Emacs version you're reporting this for, but in Emacs
> 28, the `isearch-group-2' and` isearch-group-1' faces are used for
> this. (That is, it's even/odd group matches.)

Emacs 27. I should have checked. This report can be closed then. Thanks.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50845; Package emacs. (Mon, 27 Sep 2021 13:21:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ndame <laszlomail <at> protonmail.com>
Cc: 50845 <at> debbugs.gnu.org
Subject: Re: bug#50845: Color capturing groups in query replace regexp
Date: Mon, 27 Sep 2021 15:20:20 +0200
ndame <laszlomail <at> protonmail.com> writes:

>> You don't say what Emacs version you're reporting this for, but in Emacs
>> 28, the `isearch-group-2' and` isearch-group-1' faces are used for
>> this. (That is, it's even/odd group matches.)
>
> Emacs 27. I should have checked. This report can be closed then. Thanks.

OK; closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 50845 <at> debbugs.gnu.org and ndame <laszlomail <at> protonmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 27 Sep 2021 13:21:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50845; Package emacs. (Mon, 27 Sep 2021 16:10:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: ndame <laszlomail <at> protonmail.com>, "50845 <at> debbugs.gnu.org"
 <50845 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#50845: Color capturing groups in query replace
 regexp
Date: Mon, 27 Sep 2021 16:08:54 +0000
> When doing some complex capturing and replacing it could be helpful to
> see what each of the groups captured.
> 
> So instead of coloring the match with a single color when query
> replacing, the part captured by the first parens
> has one color, the second capturing group a different color, etc. and
> after replacing if the user used a
> comma to replace but not move point to the next match, the same colors
> indicate the replacement texts for the
> corresponding groups.
> 
> And the matching parts outside of parens can have the same face which
> qrr currently uses.

FWIW, together, my libraries `isearch+.el' and
`replace+.el' do that.  (The former does it
also for Isearch.)

Each regexp group match is highlighted in the
currently search hit, and in other hits than the
current one the odd and even group matches are
highlighted (odd and even faces).

IMO, this feature is really helpful.  Regexp
matches should be shown this way, in general.
(Of course, it's optional for users.)

https://www.emacswiki.org/emacs/download/isearch%2b.el

https://www.emacswiki.org/emacs/download/replace%2b.el



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

This bug report was last modified 2 years and 154 days ago.

Previous Next


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