emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: be able to replace during isearch


From: Drew Adams
Subject: RE: be able to replace during isearch
Date: Sun, 1 Jul 2007 15:37:38 -0700

> > The idea is that you would not need to leave isearch to perform
> > replacements. Whenever you wanted to replace the current search
> > occurrence, you would hit a certain key. The first time you do
> > this, you would be asked for the replacement string.
>
> I imagine this could be like typing `R' during ispell-checking.

Dunno, I've never used that. The Emacs manual, however, says this:

 `R NEW <RET>'
     Replace the word with NEW, and do a `query-replace' so you can
     replace it elsewhere in the buffer if you wish.  (The replacements
     will be rescanned for more spelling errors.)

If `R' does indeed activate `query-replace', then no, what I propose is very
different.

In my proposal, you never enter `query-replace', and you never leave
isearch. There are simply two additional isearch key bindings, one to prompt
for and read a replacement string (expression) and the other to replace the
current search hit with that replacement.

In Icicles, these two keys are `M-,' and `C-S-RET' (or `C-S-mouse-2' or
`C-S-next' etc., depending on what you want done after the replacement), but
in isearch they should be something more appropriate for isearch.

In my proposal, you are never queried to replace anything. Instead, you
replace a search hit only upon demand, by hitting the replace key (e.g.
`C-S-RET'). If you never hit that key, then there is no replacement. There
is never any querying for replacement.

You only use the `M-,' (or equivalent) binding if you want to change the
current replacement string during the same invocation of isearch. The first
time you hit the replace key (e.g. `C-S-RET'), there is an implicit call to
`M-,' to read the replacement string.

You can think of the correspondence to `query-replace' this way:

* Instead of `query-replace' automatically moving to the next match, you
must hit `C-s'.

* Instead of hitting `y' or `n', you hit the replace key (e.g. `C-S-RET') or
you do nothing (for `n').





reply via email to

[Prev in Thread] Current Thread [Next in Thread]