From: Chunyang Xu <mail@xuchunyang.me>
To: Ole Laursen <olau@iola.dk>
Cc: emacs-devel@gnu.org
Subject: Re: Interactive query-replace
Date: Fri, 10 Feb 2017 12:38:30 +0800 [thread overview]
Message-ID: <m2inoimzi1.fsf@xuchunyang.me> (raw)
In-Reply-To: <CANb2Ov+bJx+PezmhVnkzZ7CDoOB+wgB3omHtqMmDAWXh43dboQ@mail.gmail.com>
Ole Laursen writes:
> 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
next prev parent reply other threads:[~2017-02-10 4:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2017-02-10 4:47 ` Chunyang Xu
2017-02-10 6:03 ` Stefan Monnier
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=m2inoimzi1.fsf@xuchunyang.me \
--to=mail@xuchunyang.me \
--cc=emacs-devel@gnu.org \
--cc=olau@iola.dk \
/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).