From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: killing the result of isearch Date: Tue, 7 Nov 2017 08:46:45 -0800 (PST) Message-ID: References: <433bd3d0-a506-4d89-9d10-dcbfb0e23be0@default> <852BAA28-2A50-4AD9-B8D6-9F06905A4395@gmail.com> <87r2tava5x.fsf@hornfels.zedat.fu-berlin.de> <87y3nigy86.fsf@hornfels.zedat.fu-berlin.de> <8B436DA2-1C8B-471F-8D90-08C282864A70@gmail.com> <4c3d56b0-5151-4244-8b1b-fb4376b4fa88@default> <92E2F0E3-E2FD-46A7-97C5-292894D08B5C@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1510073249 13493 195.159.176.226 (7 Nov 2017 16:47:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Nov 2017 16:47:29 +0000 (UTC) To: Jean-Christophe Helary , Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 07 17:47:25 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC724-0003E9-A2 for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Nov 2017 17:47:24 +0100 Original-Received: from localhost ([::1]:54357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC729-0000R5-Sh for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Nov 2017 11:47:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC71b-0000Qv-Vi for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 11:46:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC71X-00037a-2I for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 11:46:56 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:50746) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eC71W-00037H-Rd for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 11:46:50 -0500 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vA7GkmRV027475 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Nov 2017 16:46:48 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vA7GklD7011861 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Nov 2017 16:46:47 GMT Original-Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vA7Gkkwn031931; Tue, 7 Nov 2017 16:46:47 GMT In-Reply-To: <92E2F0E3-E2FD-46A7-97C5-292894D08B5C@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4600.0 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114781 Archived-At: > > It does result in an object you can act upon, if you want > > that. >=20 > 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. >=20 > Exactly.