unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Jean-Christophe Helary <jean.christophe.helary@gmail.com>,
	Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: RE: killing the result of isearch
Date: Fri, 10 Nov 2017 08:54:33 -0800 (PST)	[thread overview]
Message-ID: <7c7b0606-d33e-42eb-b0f6-2629b45e6728@default> (raw)
In-Reply-To: <2348DA86-8BEF-46E5-A19D-DE8306D47D95@gmail.com>

> The problem here is that the result of search is
> *only* to move point and *not* to create a region of the highlighted
> matching string. So what appears on the screen carries actually very
> little meaning *because* with vanilla emacs, there is not isearch
> function (or any other search function for that matter) that creates a
> region out of that match.

Not to belabor this too much, but `query-replace' sounds
like it might be something closer to what you are looking
for.  It is exactly about finding some text and _optionally_
replacing or deleting it.

 `RET' just finds it and exits.
 `.' replaces/deletes it and exits.
 `C-w' deletes it and exits.
 `SPC' replaces/deletes it and moves to the next occurrence.
 `!' replaces/deletes all occurrences.

 You can move backward, undo, and change replacement string.

`query-replace' is _designed to act_ on the highlighted
text (the matches).  Isearch is _not_ designed to act on
it.  (But Isearch+ also let you do that, and in any number
of ways.)

The strength of Isearch is the "I" part: _incremental_
changes to the search string are reflected in the matches.
That behavior is not really available to `query-replace',
except in a roundabout, clumsy way - it was designed
for incremental replacement decisions, but not for
incrementally changing the search pattern.

> So it really is only a decoration.

Mere "decoration", if you like.  But it's decoration with
a lot of meaning.  It _shows you what matches_ your search
pattern.  How else would you know what matches?  Is seeing
the targets clearly just decoration, or is it an important
feature?

> If something should be highlighted, it should be the position
> of point, not how point found its way there, or at least the
> full region created by the search.

Dunno what you mean by the last part.  What full region
are you suggesting might be useful to highlight?  Do you
mean the region from the current search hit back to where
search started?  If you just mean full search hits then
that's the longstanding behavior.

> Anything else has little meaning in the context of isearch.

I disagree strongly here.  For search the _most important_
things to highlight (point out in some way) are the search
hits.

If I show you an aerial photo of a region, and you ask for
the locations of the cafes (or churches or playgrounds or
restrooms) don't you think it would be helpful for me to
highlight them for you?

Which also points out that Isearch is _not_ just about
navigation - moving to some search-hit location.  It's
also - perhaps mainly - about identifying/seeing the
search hits.

It's about pointing them out: highlighting them.

That's what I use it for much of the time, when working
with code, for example.  Whether I end up moving to any
search hit, even temporarily, is a separate thing.  Just
being able to see clearly the matches is often all I need.

That many other-application "find" operations highlight
only the current search hit is a drawback, IMO, not an
advantage.

And seeing all of the search hits in the current window
is especially important for an _incremental_ search
operation, where you often change the search pattern.

If you keep to the same search pattern throughout a
static "find" operation then perhaps it's not so
important to highlight all of the search hits.

Meaning no offense, I'd suggest (in hopes that it
helps) that your reaction here sounds a bit like that
of someone encountering a frying pan for the first
time and complaining that it is not as good as a deep
pot for boiling water.  A frying pan is its own thing.

Incremental search is a thing.  It has its own features
and advantages.  It's not the only way to find things,
and it was not designed as a way to find and act on
something.  It's still useful, as designed.

But Emacs offers plenty of other ways to find things
and act on them, from `query-replace' to `grep' and
`occur', and on beyond.  Most importantly, you can
roll your own - limited only by one's imagination.



  reply	other threads:[~2017-11-10 16:54 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07  2:41 killing the result of isearch Jean-Christophe Helary
2017-11-07  5:34 ` Drew Adams
2017-11-07  6:01   ` Jean-Christophe Helary
2017-11-07  6:25     ` Søren Pilgård
     [not found]     ` <mailman.3103.1510035932.27995.help-gnu-emacs@gnu.org>
2017-11-07  7:07       ` Loris Bennett
2017-11-07  7:49         ` Jean-Christophe Helary
2017-11-07  8:43         ` Jean-Christophe Helary
     [not found]         ` <mailman.3106.1510044223.27995.help-gnu-emacs@gnu.org>
2017-11-07 10:49           ` Loris Bennett
2017-11-07 12:45             ` Jean-Christophe Helary
2017-11-07 15:26               ` Drew Adams
2017-11-07 15:51                 ` Jean-Christophe Helary
2017-11-07 16:46                   ` Drew Adams
2017-11-07 22:38                     ` Jean-Christophe Helary
2017-11-07 16:53                   ` Eric Abrahamsen
2017-11-07 17:24                     ` Drew Adams
2017-11-07 17:45                       ` Eric Abrahamsen
2017-11-08  8:21               ` Thien-Thi Nguyen
2017-11-08 13:47                 ` Emanuel Berg
2017-11-11 15:36                   ` Charles A. Roelli
     [not found]             ` <mailman.3114.1510058721.27995.help-gnu-emacs@gnu.org>
2017-11-07 15:08               ` Loris Bennett
2017-11-07 15:28                 ` Jean-Christophe Helary
2017-11-07 16:24                   ` Drew Adams
2017-11-07 22:34                     ` Jean-Christophe Helary
2017-11-07 22:54                       ` Drew Adams
2017-11-08 22:24                   ` Tomas Nordin
2017-11-08 22:44                     ` Jean-Christophe Helary
2017-11-08 23:07                       ` Emanuel Berg
2017-11-09 21:38                       ` Tomas Nordin
2017-11-10 13:11                         ` Jean-Christophe Helary
2017-11-10 16:54                           ` Drew Adams [this message]
2017-11-07  8:31     ` Marcin Borkowski
2017-11-07 15:26     ` Drew Adams
2017-11-07 20:59     ` Bob Proulx
2017-11-07 22:10       ` Drew Adams
2017-11-07 22:53         ` Bob Proulx
2017-11-07 23:15       ` Jean-Christophe Helary
2017-11-08  4:27         ` Bob Proulx
2017-11-08  5:29           ` Jean-Christophe Helary
2017-11-08 18:50             ` Bob Proulx
2017-11-07 17:53 ` Stefan Monnier
2017-11-07 22:59   ` Jean-Christophe Helary
2017-11-12 20:02     ` Tomas Nordin
2017-11-12 22:13       ` Emanuel Berg
2017-11-13 21:17         ` Tomas Nordin
2017-11-13 22:13           ` Emanuel Berg
2017-11-20  3:24           ` Emanuel Berg
2017-11-15 14:48       ` Emanuel Berg

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=7c7b0606-d33e-42eb-b0f6-2629b45e6728@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=jean.christophe.helary@gmail.com \
    /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.
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).