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: How to bind isearch-repeat-forward to F3 in a certain mode only? Date: Fri, 24 Jul 2015 00:01:12 +0200 Message-ID: <87zj2mr0t3.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1437688919 8169 80.91.229.3 (23 Jul 2015 22:01:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jul 2015 22:01:59 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 24 00:01:53 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 1ZIOYp-00086x-Ug for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Jul 2015 00:01:52 +0200 Original-Received: from localhost ([::1]:42936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIOYp-0005ap-IN for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Jul 2015 18:01:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIOYf-0005ae-LE for help-gnu-emacs@gnu.org; Thu, 23 Jul 2015 18:01:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIOYc-0000r6-GJ for help-gnu-emacs@gnu.org; Thu, 23 Jul 2015 18:01:41 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:57253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIOYc-0000qr-9Z for help-gnu-emacs@gnu.org; Thu, 23 Jul 2015 18:01:38 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 22FBB6F2004 for ; Fri, 24 Jul 2015 00:01:37 +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 fh6EX9ph2Igt for ; Fri, 24 Jul 2015 00:01:26 +0200 (CEST) Original-Received: from localhost (unknown [109.232.24.146]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 04D2A6F2003 for ; Fri, 24 Jul 2015 00:01:22 +0200 (CEST) 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:105945 Archived-At: Hi everyone, I have this: (define-key my-mode-map "/" #'isearch-forward) (my-mode is derived from special-mode, and - inspired by Firefox - I wanted to make searching easy, requiring just one key ("/") instead of two ("C-s"). Note that buffers in my-mode are read-only, so self-insert-command doesn't make any sense anyway.) However, inside isearch I still have to press C-s to go to the next occurrence. How to make F3 go to the next occurrence? For obvious reasons, I don't want to make such a change globally to isearch-mode-map. Is it possible? I tried this (in a function which creates a buffer and sets my-mode in it): ,---- | (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). Any hints? -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University