From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] (Or "question"...) isearch-kill-found Date: Mon, 31 May 2010 11:54:38 -0400 Message-ID: References: <87vda59rby.fsf@mail.jurta.org> <87vda45euq.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1275321307 10740 80.91.229.12 (31 May 2010 15:55:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 31 May 2010 15:55:07 +0000 (UTC) Cc: Juri Linkov , Deniz Dogan , Emacs-Devel devel To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 31 17:55:05 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OJ7KR-0002Rh-Fb for ged-emacs-devel@m.gmane.org; Mon, 31 May 2010 17:55:05 +0200 Original-Received: from localhost ([127.0.0.1]:48830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJ7KP-0006Qn-8u for ged-emacs-devel@m.gmane.org; Mon, 31 May 2010 11:55:01 -0400 Original-Received: from [140.186.70.92] (port=43610 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJ7KH-0006Qf-K0 for emacs-devel@gnu.org; Mon, 31 May 2010 11:54:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJ7K4-0001XT-KA for emacs-devel@gnu.org; Mon, 31 May 2010 11:54:42 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:16519 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJ7K4-0001Wx-I0 for emacs-devel@gnu.org; Mon, 31 May 2010 11:54:40 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAO94A0xMCpdY/2dsb2JhbACeMnLAbIUWBIxM X-IronPort-AV: E=Sophos;i="4.53,334,1272859200"; d="scan'208";a="66303412" Original-Received: from 76-10-151-88.dsl.teksavvy.com (HELO pastel.home) ([76.10.151.88]) by ironport2-out.pppoe.ca with ESMTP; 31 May 2010 11:54:38 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 7D55781F8; Mon, 31 May 2010 11:54:38 -0400 (EDT) In-Reply-To: <87vda45euq.fsf@stupidchicken.com> (Chong Yidong's message of "Mon, 31 May 2010 10:24:13 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125397 Archived-At: >> A command to delete the current match without exiting isearch >> would be more useful. It will allow to continue searching for the >> next matches and delete them too: >> (define-key isearch-mode-map [delete] 'isearch-delete-current-match) >> (defun isearch-delete-current-match () >> "Kills the region that isearch has found." >> (interactive) >> (kill-region isearch-other-end (point))) > I think this is a good idea, since [delete] isn't currently used. Maybe > add C-d also. Every new key we use tends to collide with its current use of "exit isearch and run the command globally bound to that key". I.e. people who currently expect C-d/delete to exit isearch and delete the next char will be badly surprised. Now, I haven't heard a proposal yet that doesn't suffer from this kind of problem, but I think that using a new key should only be done if there's a good chance that it's very rarely used (C-d might not be very frequently used to exit isearch, but there's no reason to think it's rarely used either) *and* if the new functionality is sufficiently important. In my experience deleting the matched text is not that frequent a need. Yes, I also do it every once in a while, but I also often want to delete something slightly different. Or I want to do something else with it. So I'd much rather see an "exit and set the mark at isearch-other-end" command, after which you can do C-w if you want to delete that text (I could also imagine a "set the mark isearch-other-end but don't exit", but then deleting the text would require RET C-w instead). Richard thinks that C-SPC C-r C-r works as well, but for regexp-patterns it won't always match the same text, and I must say that C-SPC C-r C-r RET C-w is pretty long winded. Still, if we want a new isearch-set-mark-and-exit, we'll need to find a good keybinding for it. I'm not sure C-SPC is a good choice (OT1H it's pretty common to use C-SPC to exit isearch, so many uses will be affected, OTOH it will behave in a similar way, just pushing the mark at the other end of the search). Of course, we could provide the command without binding it, like we've done with isearch-toggle-case-fold, isearch-toggle-regexp and a few others. Stefan