[Top][All Lists]

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

Re: isearch-query-replace-regexp and stuff

From: Juri Linkov
Subject: Re: isearch-query-replace-regexp and stuff
Date: Tue, 06 Jul 2004 19:36:38 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

David Kastrup <address@hidden> writes:
> Juri Linkov <address@hidden> writes:
>> C-M-% is a standard key binding to start regexp replacement,
>> so it should be available in isearch too.
> Well, C-s is a standard key binding to start literal searches, so the
> same argument would apply for its meaning of continuing a regexp
> search.

This analogy is appropriate (even C-M-s can continue a non-regexp
search), but at the same time I think no one would have an incentive
to type C-M-% in a non-regexp search to start a non-regexp replacement.
C-M-% is quite hard to type, and if someone still decided to type it,
this means only that it was typed with the intention to start a regexp

> Well, if I do
> C-s e[e] M-r
> on this mail, then a "failed isearch" turns into a "failed regexp
> isearch" until I press C-s again. While this has the advantage that
> M-r M-r is a noop, it seems counterintuitive.  Maybe switching with
> M-r should do something like the following?
> If looking-at (or its non-regexp equivalent) returns non-nil after the
> change, remove a potentially previous "failed" tag.  If looking-at
> returns nil, call the search "pending" instead of "failed" until C-s
> is pressed again.

Maybe it's better to always clear the failed flag after switching
with M-r, because repeating the failed search after switching the
search type has such undesirable behavior as wrapping the search and
starting from the beginning of the buffer.  After switching the search
type it should continue from the same point even if the previous search
type failed.

Juri Linkov

reply via email to

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