help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to bind isearch-repeat-forward to F3 in a certain mode only?


From: Marcin Borkowski
Subject: How to bind isearch-repeat-forward to F3 in a certain mode only?
Date: Fri, 24 Jul 2015 00:01:12 +0200

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 "<F3>") #'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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]