From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Megyei Newsgroups: gmane.emacs.help Subject: Re: customize isearch-repeat-forward Date: Fri, 14 Sep 2007 08:36:30 +0200 Message-ID: <1189751790.16865.23.camel@champfer> References: <87wsuuvw92.fsf@comcast.net> Reply-To: mathias@mnet-mail.de NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1189751812 355 80.91.229.12 (14 Sep 2007 06:36:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Sep 2007 06:36:52 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: peter hodgson Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 14 08:36:51 2007 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.50) id 1IW4nK-00032T-KN for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Sep 2007 08:36:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IW4nK-0006Q4-5G for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Sep 2007 02:36:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IW4n5-0006Pz-7r for help-gnu-emacs@gnu.org; Fri, 14 Sep 2007 02:36:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IW4n3-0006Pn-RA for help-gnu-emacs@gnu.org; Fri, 14 Sep 2007 02:36:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IW4n3-0006Pk-JB for help-gnu-emacs@gnu.org; Fri, 14 Sep 2007 02:36:33 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IW4n2-0004qn-PK for help-gnu-emacs@gnu.org; Fri, 14 Sep 2007 02:36:33 -0400 Original-Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 73B1D221BB0; Fri, 14 Sep 2007 08:36:31 +0200 (CEST) Original-Received: from [192.168.178.67] (ppp-82-135-6-241.dynamic.mnet-online.de [82.135.6.241]) by mail.mnet-online.de (Postfix) with ESMTP id 2E5A1905B3; Fri, 14 Sep 2007 08:36:31 +0200 (CEST) In-Reply-To: <87wsuuvw92.fsf@comcast.net> X-Mailer: Evolution 2.10.1 X-Detected-Kernel: Genre and OS details not recognized. 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:47572 Archived-At: On Thu, 2007-09-13 at 21:03 -0500, peter hodgson wrote: > 'M-x version' yields: > GNU Emacs 22.1.1 (i486-pc-linux-gnu, GTK+ Version 2.10.11) of 2007-08-14 > on palmer, modified by Ubuntu > --------------------- > > fellow emaculates; the pleasure of your company these past weeks has > prompted me to refine some of my customizations; > > here's what my .emacs used to say about isearch: > > (global-set-key "\ee" 'isearch-forward) isearch-forward is already bound to C-s. Do you need a different binding too? Did you look the output of C-h k C-s? > (global-set-key "\C-f" 'isearch-repeat-forward) Default binding for that is: C-s C-s > (global-set-key "\e'" 'isearch-exit) > (global-set-key "\e3" 'isearch-backward) > (global-set-key "\e2" 'isearch-repeat-backward) > > everything worked fine; then i changed one line: > > (global-set-key "\er" 'isearch-repeat-forward) > > and now all hell's broken loose; > > it starts out fine: > > when i press , i get "I-search:", so i type "key"; all occurences > of 'key' are highlighted, and the cursor is at the end of the first > occurence; With you have switched to isearch mode. (You should see the string "Isearch" in the mode line.) In isearch mode the key bindings from isearch-mode-map will overwrite the global bindings. > then i press ; > > instead of having the cursor move to the next occurence of 'key', it > stays where it was, and i get this message: > > "Pending regexp I-search: key" > > when i press again, i get: > > "Pending I-search: key" In isearch-mode-map is bound to (quoted from C-h k C-s): ... Type M-r to toggle regular-expression mode. ... > BUT IF i press after i type in "key", or after i get either of > the 'Pending...' messages, THEN Pressing you exited from isearch mode. Hence ... > when i press it moves the cursor > through the occurences of 'key', in other words, isearch-repeat-forward; ... your key binding from global-map is working as expected. > i've been eating lots of steak lately, to facilitate healing a wound; > does this .emacs difficulty suggest my karma been compromised? or is > there a lisp solution? The latter I think. If you would like to change the key bindings for isearch mode you have to change isearch-mode-map instead of the global map. Regards, Mathias