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

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

Re: replace C-s with C-f


From: David Kastrup
Subject: Re: replace C-s with C-f
Date: 17 Feb 2003 19:39:57 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Bruce Ingalls <bingalls@CUT-this-SPAM-BLOCK.fit-zones.com> writes:

> I bound C-f to isearch-forward, as follows:
> 
>    (global-set-key [(control s)] 'save-buffer)
>    (global-set-key [(control f)] 'isearch-forward)
> 
> The bindings work, but when I want to continue a search,
> by hitting C-f again, it instead stops & restarts the search.
> 
> C-g is generally bound to continuing a search, but I'd rather not
> go that route.
> 
> What is the best way to handle this?
> 

isearch-forward is an interactive compiled Lisp function in `isearch'.
It is bound to C-s, <menu-bar> <edit> <search> <i-search> <isearch-forward>.
(isearch-forward &optional REGEXP-P NO-RECURSIVE-EDIT)

Do incremental search forward.
With a prefix argument, do an incremental regular expression search instead.

As you type characters, they add to the search string and are found.
The following non-printing keys are bound in `isearch-mode-map'.

Type DEL to cancel characters from end of search string.
Type RET to exit, leaving point at location found.
[...]

The above keys, bound in `isearch-mode-map', are often controlled by
 options; do M-x apropos on search-.* to find them.
Other control and meta characters terminate the search
 and are then executed normally (depending on `search-exit-option').
Likewise for function keys and mouse button events.

*SNIP*

So the answer is obvious:  add your stuff to isearch-mode-map.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

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