[Top][All Lists]

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

Re: isearch-query-replace-regexp and stuff

From: David Kastrup
Subject: Re: isearch-query-replace-regexp and stuff
Date: 06 Jul 2004 13:20:26 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Juri Linkov <address@hidden> writes:

> David Kastrup <address@hidden> writes:
> > It might be an idea to also bind C-M-% to the same, non-type-switching
> > behavior for symmetry.  If the user wants to switch behavior, he can
> > do so with the existing M-r binding.
> 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

> > To make this more useful than just exiting search and restarting
> > replacement, we might consider letting M-r in isearches keep the
> > search string if it non-empty.  This might be done in one of
> > several ways: a) keep the search string unmodified.  This has the
> > advantage that you can keep already typed search string characters
> > even when you accidentally started with the wrong search type.
> > [...]  After thinking this over, I think that maybe something like
> > option "a)" would more often agree with what the user could expect
> > and which would offer the most _additional_ usefulness.
> AFAIU, option "a)" is exactly the current behavior.

That's what I get for not trying out things.

> And I think no improvements are needed here.

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.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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