unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Interactive query-replace
@ 2017-02-09 21:27 Ole Laursen
  2017-02-09 21:37 ` Kaushal Modi
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Ole Laursen @ 2017-02-09 21:27 UTC (permalink / raw)
  To: emacs-devel; +Cc: Ole Laursen

Hi!

I realized the other day that search and replace in Emacs isn't very
interactive when a coworker showed me another editor he was
experimenting with. What he somehow did there seemed like something
Emacs would do when query-replacing, only it doesn't.

Search and replace has three phases:

- Enter search term
- Enter replacement term
- Confirmation

Only confirmation is interactive in Emacs.

The search phase could move the cursor and highlight all matches as
you type, just like isearch. Then we can see what we're about to
overwrite.

Replacement text phase could overwrite each match visible in the
buffer with the replacement text as you type it. The replacements
would still be highlighted so it's obvious what's happening. Then we
can actually evaluate how the replacement works in practice in the
buffer before committing to it.

Confirmation then actually commits the changes to the buffer, just like today.

Doesn't this sound like something Emacs should be doing?

I'll admit I have no idea how to actually implement it.


Ole



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

end of thread, other threads:[~2017-02-10  6:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09 21:27 Interactive query-replace Ole Laursen
2017-02-09 21:37 ` Kaushal Modi
2017-02-09 21:38   ` Kaushal Modi
2017-02-09 21:42 ` Clément Pit-Claudel
2017-02-09 22:27   ` Ole Laursen
2017-02-10  4:38 ` Chunyang Xu
2017-02-10  4:47 ` Chunyang Xu
2017-02-10  6:03 ` Stefan Monnier

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