From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: How to make emacs clear search when pressing Ctrl+g? Date: Wed, 10 Feb 2010 23:02:35 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1265868211 1093 80.91.229.12 (11 Feb 2010 06:03:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Feb 2010 06:03:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 11 07:03:29 2010 Return-path: Envelope-to: geh-help-gnu-emacs@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 1NfS9A-00075j-Dd for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Feb 2010 07:03:28 +0100 Original-Received: from localhost ([127.0.0.1]:34119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfS99-0004km-Qy for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Feb 2010 01:03:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfS8i-0004jV-Cd for help-gnu-emacs@gnu.org; Thu, 11 Feb 2010 01:03:00 -0500 Original-Received: from [199.232.76.173] (port=59006 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfS8h-0004j0-IU for help-gnu-emacs@gnu.org; Thu, 11 Feb 2010 01:02:59 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfS8f-0005TH-RH for help-gnu-emacs@gnu.org; Thu, 11 Feb 2010 01:02:59 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:48650) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfS8f-0005TD-Bg for help-gnu-emacs@gnu.org; Thu, 11 Feb 2010 01:02:57 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NfS8d-0006tN-L0 for help-gnu-emacs@gnu.org; Thu, 11 Feb 2010 07:02:55 +0100 Original-Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Feb 2010 07:02:55 +0100 Original-Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Feb 2010 07:02:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71791 Archived-At: Joseph Garvin wrote: > Sometimes when I'm doing a forward search (Ctrl+s) I realize I > actually wanted to search for something different. As a shortcut to > clear the search rather than having to backspace, I press Ctrl+g to > cancel the search then press Ctrl+s again to begin a new search. But > if you do this without moving the cursor between the Ctrl+g and the > Ctrl+s steps, then the minibuffer will keep what I was searching for > before in it, defeating the whole point. Is there a good reason this > is the default behavior? I'm not sure what the advantage would be. And > regardless, is there an easy way to make it always clear as if I had > moved the cursor between the Ctrl+g and Ctrl+s steps? ,---- | File: emacs, Node: Error in Isearch, Next: Special Isearch, Prev: Repeat Isearch, Up: Incremental Search | | 20.1.3 Errors in Incremental Search -----------------------------------| | | If your string is not found at all, the echo area says `Failing | I-Search'. The cursor is after 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'. At this | point there are several things you can do. If your string was | mistyped, you can rub some of it out and correct it. If you like the | place you have found, you can type or some other Emacs command 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 `C-g' "quit" character 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. The cursor moves 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. | `---- -- Kevin Rodgers Denver, Colorado, USA