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: Le Wang
Subject: Re: replace C-s with C-f
Date: Tue, 18 Feb 2003 01:42:17 GMT
User-agent: KNode/0.7.1

David Kastrup wrote:

> Bruce Ingalls <address@hidden> writes:
> 
>> David Kastrup wrote:
>> > Bruce Ingalls <address@hidden> 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.
>> 
>> >>What is the best way to handle this?
>> ...> So the answer is obvious:  add your stuff to isearch-mode-map.
>> 
>> Thanks for the help. I have problems with the syntax.
>> At least the following compiled :)
>> 
>> (append 'isearch-mode-map '(define-key map "\C-f" 'isearch-repeat-forward))
> 
> What nonsense.  How about looking up the functions you are using with
> C-h f ?
> 
> In this case, I'd try something like
> (eval-after-load 'isearch
>   (define-key isearch-mode-map ?\C-f 'isearch-repeat-forward))
> 

Here is a sniplet from my init file.  It's commented out, because I've wholly 
given up on making Emacs work how I wish.  It's obviously much smarter than 
me.  I'd advise you to do the same.  ;) ...

;*old code* >>>>>>>>>>>>>>>>>>>
;(global-set-key [(control f)] 'isearch-forward-regexp)
;(global-set-key [(control F)] 'isearch-backward-regexp)
;(global-set-key [(control r)] 'query-replace-regexp)

;(mapcar
; '(lambda (map)
;    (define-key map [(control f)] 'isearch-repeat-forward)
;    (define-key map [(control F)] 'isearch-repeat-backward)
;    (define-key map [(tab)] 'isearch-complete)
;    (define-key map [(control s)] (lookup-key
;                                   global-map
;                                   [(control s)]))
;    (define-key map [(control r)] (lookup-key
;                                   global-map
;                                   [(control r)])))
; (list isearch-mode-map minibuffer-local-isearch-map))

--
Le


reply via email to

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