From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How to bind isearch-repeat-forward to F3 in a certain mode only? Date: Fri, 24 Jul 2015 01:09:54 +0200 Message-ID: <87wpxqqxml.fsf@mbork.pl> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1437693030 4877 80.91.229.3 (23 Jul 2015 23:10:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jul 2015 23:10:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 24 01:10:19 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ZIPd4-0001Sw-9w for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Jul 2015 01:10:18 +0200 Original-Received: from localhost ([::1]:43078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIPd3-0001Wy-BZ for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Jul 2015 19:10:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIPcr-0001Ts-U9 for help-gnu-emacs@gnu.org; Thu, 23 Jul 2015 19:10:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIPcm-0004ls-JW for help-gnu-emacs@gnu.org; Thu, 23 Jul 2015 19:10:05 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:34880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIPcm-0004lT-Bd for help-gnu-emacs@gnu.org; Thu, 23 Jul 2015 19:10:00 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 0FB0A8F2003 for ; Fri, 24 Jul 2015 01:09:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yvyCwkMtXNXi for ; Fri, 24 Jul 2015 01:09:56 +0200 (CEST) Original-Received: from localhost (unknown [109.232.24.146]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 0675B8F2002 for ; Fri, 24 Jul 2015 01:09:55 +0200 (CEST) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:5e00:2:52::8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105949 Archived-At: On 2015-07-24, at 00:53, Javier wrote: >> ,---- >> | (my-mode) >> | (make-local-variable 'isearch-mode-map) >> | (define-key isearch-mode-map (kbd "") #'isearch-repeat-forward) >> `---- >> >> but to no avail. Inspecting `isearch-mode-map' implies that it was in >> fact changed globally. Pressing F3 while in isearch, though, starts >> recording a keyboard macro anyway (both in my-mode and outside it). > > > (defun my-mode-keys () > "Keybindings for my-mode. To be used as a hook." > (local-set-key (kbd "") 'isearch-repeat-forward) > ) > (add-hook 'my-mode-hook 'my-mode-keys) > > Would this work? Is 'my-mode-hook defined in your case? Yes and no. I mean, it probably would - but then F3 would be bound to isearch-repeat-forward also outside isearch. (Not a big deal, but I'm just curious whether it's at all possible to "do it right".) Thanks, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University