unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: Juri Linkov <juri@jurta.org>, emacs-devel@gnu.org
Subject: RE: highlight failed part of isearch input
Date: Wed, 11 Jul 2007 09:10:50 -0700	[thread overview]
Message-ID: <BNELLINCGFJLDJIKDGACAEHFCAAA.drew.adams@oracle.com> (raw)
In-Reply-To: <jwvsl7vr3xy.fsf-monnier+emacs@gnu.org>

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

  parent reply	other threads:[~2007-07-11 16:10 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10  3:03 highlight failed part of isearch input Drew Adams
2007-07-10 13:21 ` Juri Linkov
2007-07-10 14:19   ` Drew Adams
2007-07-10 23:22     ` Juri Linkov
2007-07-11  0:16       ` Drew Adams
2007-07-11  3:57         ` Stefan Monnier
2007-07-11  5:27           ` David Kastrup
2007-07-11  6:18             ` Stefan Monnier
2007-07-11  6:26               ` Miles Bader
2007-07-11  7:14                 ` Stefan Monnier
2007-07-11  7:15                 ` David Kastrup
2007-07-11 16:10           ` Drew Adams [this message]
2007-07-11 19:20             ` Robert J. Chassell
2007-07-11 21:14               ` Drew Adams
2007-07-11 23:17                 ` Juri Linkov
2007-07-12 13:01                 ` Robert J. Chassell
     [not found]                 ` <E1I968h-0002xA-VO@fencepost.gnu.org>
2007-07-12 23:16                   ` Juri Linkov
2007-07-13 18:38                     ` Richard Stallman
2007-07-14 23:05                       ` Juri Linkov
2007-07-15 22:53                         ` Richard Stallman
2007-07-23  4:27                         ` Richard Stallman
2007-07-14 23:07                       ` Juri Linkov
2007-07-15 22:53                         ` Richard Stallman
2007-07-12 21:24             ` Richard Stallman
2007-07-11 21:03       ` Richard Stallman
2007-07-11 21:15         ` Drew Adams
2007-07-10 14:07 ` Masatake YAMATO
2007-07-10 14:37   ` ding susceptibility (was: highlight failed part of isearch input) Drew Adams
2007-07-10 22:01   ` highlight failed part of isearch input Richard Stallman
2007-07-10 14:32 ` Stefan Monnier
2007-07-10 22:01 ` Richard Stallman
2007-07-22 23:40   ` Drew Adams
2007-07-23 18:06     ` Richard Stallman
2007-07-23 21:29       ` Juri Linkov
2007-07-23 22:37         ` Drew Adams
2007-07-23 23:33           ` Juri Linkov
2007-07-24  2:22             ` Drew Adams
2007-07-24 22:16               ` Richard Stallman
2007-07-24 16:45         ` Richard Stallman
2007-07-24 17:25           ` Drew Adams
2008-02-11 23:31       ` Drew Adams
2008-02-12  0:18         ` Juri Linkov
2008-02-12  0:36           ` Drew Adams
2008-02-12  0:54             ` Bastien
2008-02-16 19:18               ` Juri Linkov
2008-02-23 19:47                 ` Juri Linkov
2008-02-23 21:27                   ` Drew Adams
2008-02-23 21:55                     ` Juri Linkov
2008-02-23 23:12                       ` Drew Adams
2008-02-24 17:32                         ` Juri Linkov
2008-02-24 23:15                           ` Drew Adams
2008-02-25  0:01                             ` Juri Linkov
2008-02-25  7:59                             ` Bastien
2008-02-24 23:31                           ` Dan Nicolaescu
2008-02-24 23:47                             ` Drew Adams
2008-02-24 23:58                               ` Dan Nicolaescu
2008-02-25  0:00                               ` Jason Rumney
2008-02-25  0:12                                 ` Drew Adams
2008-02-25  0:17                                 ` Juri Linkov
2008-02-24 17:29                   ` Juri Linkov
2008-02-24 23:05                     ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BNELLINCGFJLDJIKDGACAEHFCAAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).