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: Tue, 7 Nov 2017 08:46:45 -0800 (PST)	[thread overview]
Message-ID: <d024aeed-729c-4d2a-84bb-7b0c07e843e3@default> (raw)
In-Reply-To: <92E2F0E3-E2FD-46A7-97C5-292894D08B5C@gmail.com>

> > It does result in an object you can act upon, if you want
> > that.
> 
> Would you mind being more specific ?

The code finds a match (over and over: successive matches).
Code (hence you) can act on the current match.  Or code/you
can act on only the last match that you visit.

Everything you need to code the feature you ask for is in the
Isearch source code.  If you don't want to dig into that code
yourself, you're lucky: Isearch+ already provides what you need:

1. A variable whose value can be any function you want,
   tailor-made to act on any current match when you hit a key.

   Write any number of commands, which bind that variable
   to different action functions.  Bind those commands to
   keys in `isearch-mode-map'.  Now you have N keys you can
   hit to perform N different actions on a search hit.
   Pretty good, no?

2. As for acting on the last-visited match, after searching:
   Isearch+ lets you automatically, or on-demand, select it
   as the active region.  You can then use any Emacs command
   that acts on the active region to act on it.  And you can
   define your own such commands, to act on it any way you like.

Be aware too that after you exit Isearch, you can always use
the many Emacs commands that act on text before point or that
move point backward.  There is a lot you can do to the text
before point, even without selecting the part that matches
your last search.  Emacs has commands for moving among and
killing sexps, for example.

> I have no problem using new libraries, but I want to understand why I am
> missing what I think I am missing. If I understood searches (isearches ?)
> better, maybe I would not have my questions.

You are missing what you think you are missing from vanilla
Emacs.  Why?  Because either (1) no one has considered them
important/useful enough to add or (2) no one has volunteered
to work on implementing them.

Emacs is developed by volunteers.  Features are added to it
when its core developers decide to do so.  There are tons
of wonderful Emacs features that have not been incorporated
into vanilla Emacs.  Sometimes that's good; sometimes it's
not so good.  What gets done in vanilla Emacs is a function
of those who contribute directly to its development.  They
do what they want (think is best), naturally.

I think that lots of features that Isearch+ provides, perhaps
all, would make sense in vanilla Emacs.  I've volunteered them.
But it's not for me to decide.

In any case, you can use them now - easily.  You don't need
them to be added to vanilla Emacs to take advantage of them.

Above is just my answer to your "Why not?" question.  What
you're looking for is not part of Emacs by default because
those who maintain Emacs haven't added it - nothing more.
That doesn't mean you're not understanding something, and
it doesn't imply that they're not understanding something.
People are different.

> > Q-r is nice, and it's good you can invoke it from Isearch,
> > but it is not the same thing as on-demand replacement
> > during search.
> 
> Exactly.



  reply	other threads:[~2017-11-07 16:46 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 [this message]
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
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=d024aeed-729c-4d2a-84bb-7b0c07e843e3@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).