From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Isearch: retrieve last successful search string from when you quit (`C-g') Date: Tue, 02 Oct 2012 18:48:20 +0200 Message-ID: <83y5joakh7.fsf@gnu.org> References: <0860CD16FA6A43A7B3FB40FE34C6B934@us.oracle.com> <87obkl5d42.fsf@spindle.srvr.nix> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1349196542 16866 80.91.229.3 (2 Oct 2012 16:49:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Oct 2012 16:49:02 +0000 (UTC) Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, drew.adams@oracle.com, dmoncayo@gmail.com To: Nix Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 02 18:49:04 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TJ5dy-0000gj-Lj for ged-emacs-devel@m.gmane.org; Tue, 02 Oct 2012 18:48:26 +0200 Original-Received: from localhost ([::1]:55158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ5dt-0002Aq-3g for ged-emacs-devel@m.gmane.org; Tue, 02 Oct 2012 12:48:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ5dq-0002AO-W9 for emacs-devel@gnu.org; Tue, 02 Oct 2012 12:48:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJ5dm-00014L-Ln for emacs-devel@gnu.org; Tue, 02 Oct 2012 12:48:18 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:54396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ5dm-00014C-4j for emacs-devel@gnu.org; Tue, 02 Oct 2012 12:48:14 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MB900900YM54100@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Tue, 02 Oct 2012 18:48:11 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MB90081BYOBUF60@a-mtaout22.012.net.il>; Tue, 02 Oct 2012 18:48:11 +0200 (IST) In-reply-to: <87obkl5d42.fsf@spindle.srvr.nix> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153927 Archived-At: > From: Nix > Emacs: (setq software-quality (/ 1 number-of-authors)) > Date: Tue, 02 Oct 2012 12:26:21 +0100 > Cc: Stefan Monnier , > Drew Adams , emacs-devel@gnu.org > > Perhaps I'm just an idiot, but I always thought the current > isearch behaviour of not immediately quitting when C-g was stuck on a > failed search was a *bug*. Only now, after Drew commented on it, do I > notice that it's removing the unfound component of the failed search: > i.e., it's a feature, but unless you spend your time looking at the echo > area while isearching (and who does that?) they'll never notice it. They could read the manual. 15.1.3 Errors in Incremental Search ----------------------------------- If your string is not found at all, the echo area says `Failing I-Search', and the cursor moves past the place where Emacs found as much of your string as it could. Thus, if you search for `FOOT', and there is no `FOOT', you might see the cursor after the `FOO' in `FOOL'. In the echo area, the part of the search string that failed to match is highlighted using the face `isearch-fail'. At this point, there are several things you can do. If your string was mistyped, you can use to erase some of it and correct it. If you like the place you have found, you can type to remain there. Or you can type `C-g', which removes from the search string the characters that could not be found (the `T' in `FOOT'), leaving those that were found (the `FOO' in `FOOT'). A second `C-g' at that point cancels the search entirely, returning point to where it was when the search started. The quit command, `C-g', does special things during searches; just what it does depends on the status of the search. If the search has found what you specified and is waiting for input, `C-g' cancels the entire search, moving the cursor back to where you started the search. If `C-g' is typed when there are characters in the search string that have not been found--because Emacs is still searching for them, or because it has failed to find them--then the search string characters which have not been found are discarded from the search string. With them gone, the search is now successful and waiting for more input, so a second `C-g' will cancel the entire search.