unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#73745: Add query-replace-reverse functions
@ 2024-10-11 11:00 Dan Jacobson
  2024-10-11 13:08 ` Eli Zaretskii
  2024-10-14 17:45 ` Juri Linkov
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Jacobson @ 2024-10-11 11:00 UTC (permalink / raw)
  To: 73745

I am looking at the M-% prompt:
```
Query replace (default <h2 → <h2 class="zzz"): <h2 → <h2 class="zz"
```
and I am wondering how to get it to do the reverse?

It is prompting with my previous action, but now I want to do the exact
opposite,   `<h2 class="zz" → <h`
No, I can't just put my (emacs -nw) cursor on top of the arrow and hit M-t.
https://stackoverflow.com/questions/39700435/emacs-query-replace-regexp-reverse-order-of-default#comment132667451_39705933
because my string is not so simple.

>Just hit the undo button.

I don't want to do an undo, I want to do a reverse query replace of my
previous query replace.

Wait. And then it dawned on me: emacs needs a
reverse-previous-query-replace function.

It would be just like query-replace, but using B -> A instead of A -> B.

And doing ESC p should march through the query replace history, but with
each pair reversed!

And same for query-replace-regexp. There needs to be a
reverse-query-replace-regexp too.

Or maybe call them query-replace-reverse, etc.





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

end of thread, other threads:[~2024-10-15  6:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 11:00 bug#73745: Add query-replace-reverse functions Dan Jacobson
2024-10-11 13:08 ` Eli Zaretskii
2024-10-14 17:45 ` Juri Linkov
2024-10-14 21:32   ` Stefan Kangas
2024-10-15  6:17     ` Juri Linkov

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).