From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: killing the result of isearch Date: Tue, 07 Nov 2017 08:53:40 -0800 Message-ID: <87tvy6114b.fsf@ericabrahamsen.net> 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 X-Trace: blaine.gmane.org 1510073764 28627 195.159.176.226 (7 Nov 2017 16:56:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Nov 2017 16:56:04 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 07 17:56:01 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 1eC7AN-0007Bm-7v for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Nov 2017 17:55:59 +0100 Original-Received: from localhost ([::1]:54393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC7AU-0003f9-Lr for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Nov 2017 11:56:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC7A2-0003f0-P5 for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 11:55:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC79y-0006eR-9z for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 11:55:38 -0500 Original-Received: from [195.159.176.226] (port=44170 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC79y-0006e5-2z for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 11:55:34 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eC79l-0005j3-6B for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 17:55:21 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 58 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:JxK8X5RgexuTum/J/tTJsDoBtQo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:114783 Archived-At: Jean-Christophe Helary writes: >> On Nov 8, 2017, at 0:26, Drew Adams wrote: >> >>>> So doesn't searching-and-replace with an empty replacement work? >>> >>> It works to accomplish the same result but it takes many more step as I >>> wrote earlier: >>> >>> isearch string >>> isearch-query-replace >>> (replace with nothing) >> ... >>> The problem with emacs and searches, is that you only search, you don't >>> *find*, as in the action of searching does not result in an object that you >>> can act upon. Which defeats the purpose of searching. >> >> It does result in an object you can act upon, if you want >> that. > > Would you mind being more specific ? > > 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. > >> 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. Several years ago, when I wanted to do this, I wrote the following: (define-key isearch-mode-map (kbd "M-m") 'my-isearch-mark-search-as-region) (defun my-isearch-mark-search-as-region () (interactive) (if (not isearch-mode) (message "This is only useful during isearch") (isearch-exit) (push-mark isearch-other-end) (activate-mark))) I guess that's just a tiny half-step in the direction that isearch+ is headed. Another very good facility to get comfortable with is recursive editing: type "C-r" during search mode, do whatever editing you like, then "C-M-c" to go back into search mode. I think what people are trying to say is that Emacs' defaults can often seem lacking, but it makes up for it by giving you enormous power to create your ideal behavior yourself. I think this is probably born of decades of strong personalities, wildly varying "ideal behavior", and a distaste for bikeshedding. I think we all expect that we need to go the last half-mile ourselves. Eric