[Top][All Lists]

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

Re: Word Delimited Query Replace

From: Stefan Monnier
Subject: Re: Word Delimited Query Replace
Date: Sat, 18 Oct 2008 22:08:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>>> Currently, M-s w is broken, and I'll will try to fix it.  But even
>>> after it is fixed, I think it would be good to provide two ways to run
>>> word replacement from isearch, exactly as we already provide two ways
>>> to run regexp replacement:
>>> regexp search/replace: C-M-s M-% and C-s C-M-%
>>> word search/replace: M-s w M-% and C-s C-u M-%
>> I'd rather discourage the second alternatives.  After all, C-s C-M-% is
>> rather odd since it'll use the string you searched as a regexp, so if
>> you were searching for the string "a*b" the replacement will not apply
>> to what isearch matched.

> IMHO, it would be worse when the user habitually types C-u M-% to run
> word replacement or C-M-% to run regexp replacement and these keys do not
> do what the user wants.

They still do what the user wants outside of isearch.  But the new
"query-replace from isearch" only works with M-% (which is one of the
advantages I see in this M-%: it provides the same featureset while
using fewer keys: the global M-% and C-M-% can be used for anything
else now).

As it happens, it seems that the problem you found is due to your
setting isearch-allow-scroll=t which caused the C-u to be eaten without
passing it to the query-replace, whereas with isearch-allow-scroll=nil
the C-u exits isearch and is then passed to query-replace correctly.

So I guess your change is OK: in the case that C-u is eaten by
isearch-allow-scroll=t, then the C-u will be passed on to query-replace,
and if it's not, then your change makes no difference and the C-u
exits isearch.

> We could provide these keys only as a back-up for the case we the user
> intuitively types it, and discourage them simply by not advertising in
> the documentation.

Yes, it's probably OK,


reply via email to

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