From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?U8O4cmVuIFBpbGfDpXJk?= Newsgroups: gmane.emacs.help Subject: Re: killing the result of isearch Date: Tue, 7 Nov 2017 07:25:25 +0100 Message-ID: References: <433bd3d0-a506-4d89-9d10-dcbfb0e23be0@default> <852BAA28-2A50-4AD9-B8D6-9F06905A4395@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1510035961 27506 195.159.176.226 (7 Nov 2017 06:26:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Nov 2017 06:26:01 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Jean-Christophe Helary Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 07 07:25:53 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 1eBxKa-0006fu-P9 for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Nov 2017 07:25:52 +0100 Original-Received: from localhost ([::1]:51603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBxKg-0001k6-8m for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Nov 2017 01:25:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBxKD-0001jp-Lf for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 01:25:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBxKC-0000kE-9A for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 01:25:29 -0500 Original-Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:50255) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eBxKB-0000jq-NU for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 01:25:27 -0500 Original-Received: by mail-wm0-x233.google.com with SMTP id s66so1298644wmf.5 for ; Mon, 06 Nov 2017 22:25:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GdDbtneoIM56qyR05XFknDZC05GAc1upwUVT2Rmdl3M=; b=vN84qq35gsXHxUk3DotCJOCokavy2W+o1TWcOKkoPQAdGTOLSmVVAfdKjOhUVTtb7k HThEvSaSP8dJtmnDI5AD02xGwzp0LoGyhKEhPFn+ZqMFBoarv8AJQ7Ae3FmjP+TSt2pd AnWA+AeW5MIIsxy/NyFHfeiXRSUslfDXEtPNunemPN3rllNDHLCbMt/E4bbHCCzMdgxv Y9YIjLz5lzH05+P8e7HEF0GTKOrOVxbmlQTMfX6YpeGkLSGbtrmDijSKaS84103EU7kL F9HQBZc9Gd5A9MFNHh5dLiNtFDAADNXt+g106lgk4WUquJd5lHOVVL4uV4jwvbqxhy/h +A2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GdDbtneoIM56qyR05XFknDZC05GAc1upwUVT2Rmdl3M=; b=kAL72RcB/rtyEVGpxYxxfnTHgBZ3Aysm8myM/rofJ8q1wUqy7BvvGUvtDPxmAm1NVq bzaxGRoMwl9okr6UcuSWXmTUxRQX835ylP0j8rNCmCGOq3x8t+dXs7QKWBkrXDHIAI2z /Fpf0McMAzCRpvsM8QNJx+MgzpTjgw1Xxuc9Fl4HrnrizhLUXT0nsVjBQgpmRJEUeISj UzlbScbhwlBtLhBeqa1L7XJewO7dxE5/2VTH2r08X1YupTopn2T3qFSLdMJSLcix+bJb W2ilU5xQgCAJdeHVyG56Dv457pAlaQahFxdfJs4ZRYutN9cOhxj5YpfcCeydZexRdIKo bnbg== X-Gm-Message-State: AMCzsaVc2emHgl2/jM4BgNs8Y6q0BP5e9/osimm0lZGSbleE7pKjeSdn vn0/QXr60f3PMZCHXqZLv21LKsjg5gnLQaAvQ6Q= X-Google-Smtp-Source: ABhQp+TB/PS8X5QoGMN8QrShLkGDnKghfN/o9iIFzfhJS7Mf7ldt/Gbm1Qjbnff/OwMuwqfJe637e4P91wifGKPX+DE= X-Received: by 10.80.228.65 with SMTP id e1mr22993677edm.245.1510035926066; Mon, 06 Nov 2017 22:25:26 -0800 (PST) Original-Received: by 10.80.175.100 with HTTP; Mon, 6 Nov 2017 22:25:25 -0800 (PST) Original-Received: by 10.80.175.100 with HTTP; Mon, 6 Nov 2017 22:25:25 -0800 (PST) In-Reply-To: <852BAA28-2A50-4AD9-B8D6-9F06905A4395@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::233 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:114763 Archived-At: On Nov 7, 2017 7:04 AM, "Jean-Christophe Helary" < jean.christophe.helary@gmail.com> wrote: > On Nov 7, 2017, at 14:34, Drew Adams wrote: > >> I must be missing something big... > > No, you're not. I'm not sure that makes me feel better... But that you very much for the thorough reply. >> I have an isearch that highlights a string, and I just want to delete that string. >> >> In other editors I'd just hit delete on that selection, but that won't work in emacs... > > Not in vanilla Emacs, no; it won't work. > If you use Isearch+ Is there a way to emulate that in vanilla emacs? Well, I guess yes, by creating the adequate function, etc. But, isn't it something emacs users do normally? Search for a string and just delete it? Doesn't it look like a function that could be useful in vanilla emacs? Jean-Christophe > then you can hit `C-M-RET' to delete the > search hit. (The current search hit is not the "selection", > BTW, in the sense of being the Emacs region.) > > [If you prefer that the key for this be, say, the `' > key, then just bind command `isearchp-act-on-demand' to > `(kbd "")' in `isearch-mode-map'.] > > With Isearch+, `C-M-RET' performs an action on the current > search hit. By default, the action is to replace it with > some replacement text. And by default that replacement > text is empty (""), i.e., the search hit is deleted. > > The value of option `isearchp-on-demand-action-function' > is the function that acts on the current search hit, which > it is passed when you hit `C-M-RET', along with the buffer > start and end positions of the search hit. > > After applying the action, search moves to the next hit in > the same search direction, so just repeating `C-M-RET' > carries out the action on subsequent hits. > > With a prefix argument, `C-M-RET' prompts for the > replacement text, which is used thereafter until you again > use a prefix arg. (Again, no prefix arg means empty > replacement text, i.e., deletion.) > > Since you can use a prefix arg at any time, you can > provide different replacements for different search hits > corresponding to the same search pattern. > > [To use a prefix arg within Isearch, you must set > `isearch-allow-prefix' to non-`nil'.] > > There's more you can do with it. See here: > > https://www.emacswiki.org/emacs/IsearchPlus#isearchp-act-on-demand > Jean-Christophe Helary ----------------------------------------------- @brandelune http://mac4translators.blogspot.com You could just use the query-replace functionality with an empty string.