emacs-devel
[Top][All Lists]
Advanced

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

RE: highlight failed part of isearch input


From: Drew Adams
Subject: RE: highlight failed part of isearch input
Date: Wed, 11 Jul 2007 09:10:50 -0700

> >> There is one inconsistence: when incrementally adding characters to the
> >> search string it highlights one part (only failed) of the
> >> search string, but when repeating the search with the same string
> >> from the search ring, it highlights the whole string.  This is a
> >> minor inconsistence, and can be tolerated if unavoidable.
>
> > Yes. I don't know how to fix that.
>
> We could simply try to find the longest prefix which does have a match.
> Can't be that hard.

The rest of my message said that I do not think such a fix is even a good
idea. I probably should not even have said that I don't know how to fix
that, since I don't think it should be "fixed".

Starting again with `C-s C-s' is, IMO, asking Emacs to find the whole search
string; it is not asking it to find the part that can be found. At least,
that's how I interpret such a user intention.

If that's so, it doesn't make sense to try to find as much as can be found.
It is not necessarily the case that the search is done in the same buffer as
the last search, or that that buffer has not changed considerably, or even
that the search is done in a buffer for which the previous search string
makes sense at all.

When you search for such a previously used string, Emacs does not, in any
case, try to find as much of it as it can find; it simply reports failure.
So, if you want the behavior you describe, it means more than a tweak to the
failure-highlighting I proposed; it implies a change of Isearch behavior.

When you search for such a string, Emacs does not let you simply use `DEL'
to back out the failure part, character by character; hitting `DEL' removes
the entire search string at once. Again, if you want the behavior you
describe, it means a change of Isearch behavior, generally.

I don't think that such a change in Isearch behavior is a good idea. I
prefer that it immediately fail, and that `DEL' immediately wipe out the
entire failed search string.

Consequently (with no change in Isearch behavior), there should be no
attempt to highlight only the failed part: the search string as a whole is
what is sought, and the search string as a whole represents a match failure.
It makes sense, given the current Isearch behavior, to highlight the whole
search string as a failure.






reply via email to

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