unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: ndame <laszlomail@protonmail.com>,
	"50845@debbugs.gnu.org" <50845@debbugs.gnu.org>
Subject: bug#50845: [External] : bug#50845: Color capturing groups in query replace regexp
Date: Mon, 27 Sep 2021 16:08:54 +0000	[thread overview]
Message-ID: <SJ0PR10MB548848EB2A5898E6CED672FBF3A79@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <KRGHdM2JQ_s14ZinZVCU3neDMS8QOtXxvuFgFB2TX-4-vsX0g3uD9cinczdo0_wKCIQXZGK2Y3m1emLt_BoLYqnVudfZs88aQR_TMRgu6QU=@protonmail.com>

> 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



      parent reply	other threads:[~2021-09-27 16:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 12:54 bug#50845: Color capturing groups in query replace regexp ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-27 13:03 ` Lars Ingebrigtsen
2021-09-27 13:12   ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-27 13:20     ` Lars Ingebrigtsen
2021-09-27 16:08 ` Drew Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB548848EB2A5898E6CED672FBF3A79@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=50845@debbugs.gnu.org \
    --cc=laszlomail@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).