From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.help Subject: Re: killing the result of isearch Date: Tue, 7 Nov 2017 15:01:19 +0900 Message-ID: <852BAA28-2A50-4AD9-B8D6-9F06905A4395@gmail.com> References: <433bd3d0-a506-4d89-9d10-dcbfb0e23be0@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1510034585 23428 195.159.176.226 (7 Nov 2017 06:03:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Nov 2017 06:03:05 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 07 07:03:02 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 1eBwyS-0005tG-Ss for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Nov 2017 07:03:01 +0100 Original-Received: from localhost ([::1]:51555 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBwya-00060l-8u for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Nov 2017 01:03:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBwxe-0005xv-9Z for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 01:02:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBwxa-00081f-2M for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 01:02:10 -0500 Original-Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:50069) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eBwxZ-00081X-PB for help-gnu-emacs@gnu.org; Tue, 07 Nov 2017 01:02:05 -0500 Original-Received: by mail-pf0-x22f.google.com with SMTP id i5so9560418pfe.6 for ; Mon, 06 Nov 2017 22:02:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=PONeyn8+AEcvS2F1tLNxS9ArGiPoyeI+mbvLMRDE7oo=; b=iLZw5SIuJcSznitFZ6uQUzvsI39GbmnR8ocIlowd0/vDbs8lQQBepnxp9f0WYZQBrH NFt0NYXTsg5UgmFskqSyw2U13NCjXTGA9IEjVnA5lAmrTZGANY4dn2i5y2Y3o05qHcCD PS16IFyVbuCwPKgp94/iz80LDG1/KQfp/AYWjABdBQNnhJar88/2lIq8OntfThKbbbwI E2+oBpxiaWi6Cw2aWsXYAiP7m1LpK5W8R0TbHkhKzMLZkX6eorbllUHeSNfcfD7KyqZL IXJSoGO9xCSPKSp0U/EF7opUR0SgvCUj3jXlh0MjrvZ9J2pQo3XaX29FH+CVqTfSmzhL FSrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=PONeyn8+AEcvS2F1tLNxS9ArGiPoyeI+mbvLMRDE7oo=; b=T6Ii/kTVhOKdA7FSlPcXFeS/t32+EPDv4/ZyScltN1FrdCjURDxgUSriC5V52PYsjQ aOd6OIMcqVKPH0jMX4UXSSj5y41b4qJsK2MIPWgU8jenco6MaJzhIUo4Vhm8JyviusPY +0CqALyGPgzWIlVlNhewjPMt5qhwALdaIivzczNZsFOuqER/V5XvOdgKRxOQ2pLWVfbL SzjmiZAHzSwCs4ePgaccfL/t46/BJ68TJHQwS7V8diZPhsNaDFRlqXztoRyCMw6dqLio XmFpAtdfuicM2TCHkuTTFo05MveDeleK8HC8NmGoZwwx9yLFmgKcJDos6e2jd1PEhnYs MGJg== X-Gm-Message-State: AMCzsaWrlpJG1tHihXNhCPfQDb8TAga8yurm1mMn/qrcgvuxjxwHQmCz xgT2I7TRjiGH/YTPDgCCaQ/ubcHZ X-Google-Smtp-Source: ABhQp+RNvsB1Ts1VSm5a+DhKp7sJkaav9KO5Ez4VRCF0BWlp0aLxRNxPfwzjQFh6Cw2x4eU35GRY5g== X-Received: by 10.99.127.67 with SMTP id p3mr17610003pgn.321.1510034524466; Mon, 06 Nov 2017 22:02:04 -0800 (PST) Original-Received: from [10.254.2.129] ([210.160.37.44]) by smtp.gmail.com with ESMTPSA id e17sm1013676pfb.53.2017.11.06.22.01.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 22:02:03 -0800 (PST) X-Priority: 3 In-Reply-To: <433bd3d0-a506-4d89-9d10-dcbfb0e23be0@default> X-Mailer: Apple Mail (2.3445.4.7) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22f 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:114762 Archived-At: > On Nov 7, 2017, at 14:34, Drew Adams wrote: >=20 >> I must be missing something big... >=20 > 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. >>=20 >> In other editors I'd just hit delete on that selection, but that = won't work in emacs... >=20 > 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=20 > 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.) >=20 > [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'.] >=20 > 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. >=20 > 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. >=20 > 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. >=20 > 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.) >=20 > 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. >=20 > [To use a prefix arg within Isearch, you must set > `isearch-allow-prefix' to non-`nil'.] >=20 > There's more you can do with it. See here: >=20 > https://www.emacswiki.org/emacs/IsearchPlus#isearchp-act-on-demand >=20 Jean-Christophe Helary ----------------------------------------------- @brandelune http://mac4translators.blogspot.com