unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53181: Live preview of regexp replace
@ 2022-01-11  6:41 ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-01-11  9:04 ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-01-11  6:41 UTC (permalink / raw)
  To: 53181

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

I've been using the visual regexp package for a while and it's really useful:

https://github.com/benma/visual-regexp.el

It would improve the core emacs experience if the built in regexp replace did this as well. When constructing a regexp replace it's really useful to see the match and the capturing groups instantly in the buffer, and also the resulting text on the fly when typing the replacement. It spares you from doing several test-fix cycles until you get the regexp replacement right, because you have an instant live preview of everything in the target buffer.

Adding this feature would benefit the default regexp replace experience a lot.

[-- Attachment #2: Type: text/html, Size: 954 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53181: Live preview of regexp replace
  2022-01-11  6:41 bug#53181: Live preview of regexp replace ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-01-11  9:04 ` Juri Linkov
  2022-01-11 13:28   ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2022-01-11  9:04 UTC (permalink / raw)
  To: ndame; +Cc: 53181, Augusto Stoffel

> I've been using the visual regexp package for a while and it's really
> useful:
>
> https://github.com/benma/visual-regexp.el
>
> It would improve the core emacs experience if the built in regexp replace
> did this as well.  When constructing a regexp replace it's really useful to
> see the match and the capturing groups instantly in the buffer, and also
> the resulting text on the fly when typing the replacement.  It spares you
> from doing several test-fix cycles until you get the regexp replacement
> right, because you have an instant live preview of everything in the target
> buffer.
>
> Adding this feature would benefit the default regexp replace experience a lot.

This is exactly what Augusto is currently doing in bug#53126.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53181: Live preview of regexp replace
  2022-01-11  9:04 ` Juri Linkov
@ 2022-01-11 13:28   ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-01-11 17:58     ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-01-11 13:28 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 53181, Augusto Stoffel


> This is exactly what Augusto is currently doing in bug#53126.

I checked it and it's not the same. It says:

" the highlighting and count of matches as one types a regexp or string to
replace in `query-replace{-regexp}'."

So it may do the first part, the highlighting of the regexp pattern while typing,
but it does not seem to do the second part, that is showing the replacement effects
in the buffer immediately as the user types the replacement text or pattern.

The second part is just as important, because that shows if the actual replacement
is correct or it needs some tweaking before starting replacing.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53181: Live preview of regexp replace
  2022-01-11 13:28   ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-01-11 17:58     ` Juri Linkov
  2022-01-11 18:27       ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-01-13  7:23       ` Lars Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Juri Linkov @ 2022-01-11 17:58 UTC (permalink / raw)
  To: ndame; +Cc: 53181, Augusto Stoffel

>> This is exactly what Augusto is currently doing in bug#53126.
>
> I checked it and it's not the same. It says:
>
> " the highlighting and count of matches as one types a regexp or string to
> replace in `query-replace{-regexp}'."
>
> So it may do the first part, the highlighting of the regexp pattern while typing,
> but it does not seem to do the second part, that is showing the replacement effects
> in the buffer immediately as the user types the replacement text or pattern.
>
> The second part is just as important, because that shows if the actual replacement
> is correct or it needs some tweaking before starting replacing.

Augusto is porting the package anzu to the core, and anzu implemented
the second part that shows the replacement effects immediately:

https://github.com/emacsorphanage/anzu.git





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53181: Live preview of regexp replace
  2022-01-11 17:58     ` Juri Linkov
@ 2022-01-11 18:27       ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-01-13  7:23       ` Lars Ingebrigtsen
  1 sibling, 0 replies; 6+ messages in thread
From: ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-01-11 18:27 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 53181, Augusto Stoffel


> Augusto is porting the package anzu to the core, and anzu implemented
> the second part that shows the replacement effects immediately:

That's great. Though, hopefully he'll take a look at visual-regexp too,
to see what options it provides.

E.g. showing both the orignal string and the replacement string in the
buffer preview (A -> B) vs showing only the replacement, that is the
outcome (vr/default-replace-preview).






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53181: Live preview of regexp replace
  2022-01-11 17:58     ` Juri Linkov
  2022-01-11 18:27       ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-01-13  7:23       ` Lars Ingebrigtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-13  7:23 UTC (permalink / raw)
  To: Juri Linkov; +Cc: ndame, 53181, Augusto Stoffel

Juri Linkov <juri@linkov.net> writes:

>>> This is exactly what Augusto is currently doing in bug#53126.

[...]

> Augusto is porting the package anzu to the core, and anzu implemented
> the second part that shows the replacement effects immediately:
>
> https://github.com/emacsorphanage/anzu.git

So altogether, it seems like this is being handled elsewhere, and I'm
therefore closing this bug report.

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-13  7:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11  6:41 bug#53181: Live preview of regexp replace ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-11  9:04 ` Juri Linkov
2022-01-11 13:28   ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-11 17:58     ` Juri Linkov
2022-01-11 18:27       ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-13  7:23       ` Lars Ingebrigtsen

Code repositories for project(s) associated with this 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).