Subject: bug#48009: 28.0.50; Support query-regexp-replace using re-builder

From: Stefan Kangas <[email-masked]>
Date: Sun, 25 Apr 2021 05:46:35 -0500

Phil Sainty <[email-masked]> writes:

> It would be nice to be able to use `re-builder' to interactively
> craft a regexp to pass to `query-replace-regexp' in a streamlined
> manner.

I think it's a good idea.

> I initially wondered about a command for "query-replace-regexp but
> automatically using re-builder" (i.e. instead of typing M-C-%), but
> I'm not sure that would be very different to just binding `re-builder'
> to a key, as you'd still need a custom binding from inside re-builder
> to say you were done.  Perhaps such a command would automatically
> close the re-builder buffer once the replacements stopped, though?

Why not make `query-replace-regexp' work exactly like isearch does,
i.e. interactively update its matches?  I.e. why should users need to
know about `re-builder' to take advantage of this?

Something like that could be added in addition to a command to go from
`re-builder' to `query-replace-regexp'.