emacs-devel
[Top][All Lists]
Advanced

[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 19:29:17 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Juri Linkov <address@hidden> writes:

> 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.

So what incentive would there be to continue a non-regexp search with
C-M-s?  The point is that it makes sense to make the bindings
identical in regexp searches, so it would be strange to separate them
again in non-regexp searches.

> 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 replacement.

C-M-s 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 search.

In short: you are arguing against consistency.

> > 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.

Well, my proposal would not have "failed" in the display after the
switch, so it would be natural not to have the flag set, either.  The
question is just whether one should change the display to "pending"
to indicate this change, or simply don't mention this somewhat
peculiar state at all.

> After switching the search type it should continue from the same
> point even if the previous search type failed.

Definitely.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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