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

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

Re: [h-e-w] key-binding: C-s and ESC


From: David Vanderschel
Subject: Re: [h-e-w] key-binding: C-s and ESC
Date: 08 Nov 2002 12:57:36 -0600

On Friday, November 08, "Daniel Hegyi" <address@hidden> wrote:
>I'd like to replace the standard C-s shortcut for
>isearch-forward-regexp with C-f ...

Note that C-s is normally bound to isearch-forward,
not isearch-forward-regexp.  The latter is normally
bound to C-M-s.  But they both use the same keymap.

>However, I don't know how to assign the "find next"
>functionality that gets triggered when I press C-s
>again to the C-f key binding. Does anybody know how
>to do that?

Once you get into isearch mode, the keymap being used
is isearch-mode-map.  You need to define your
alternative to C-s in there too.  You need:

(define-key isearch-mode-map "\C-f" 'isearch-repeat-forward)

It is probably OK to leave C-s defined as it is in
isearch-mode-map; but if you want to cancel that:

(define-key isearch-mode-map "\C-s" nil)


I really do not recommend messing with these bindings.
C-s for isearch is so fundamental to emacs that
departing from normal here is going to cause problems
if you should ever become a big user of emacs.  C-f
for forward-char is also very fundamental.  Other
folks familiar with emacs will have difficulty using
yours if you change such things.  (You can usually get
away with modifying some of the less frequently used
bindings without too much trouble.)  

(When I started using emacs a couple decades ago, I
was an experienced user of DEC's EDT editor.  There
was an EDT package for emacs which modified key
bindings to work like EDT.  After operating that way
for years, I eventually realized that I was working at
cross purposes with emacs and that I should have tried
to learn the standard emacs key bindings.  I had a
break from emacs for a couple years; and, when I
resumed using it, I bit the bullet and ditched my EDT
emulation package.  It was worth it!)

Interestingly, I have defined C-f in my own
isearch-mode-map; but, in my case, it is to add a
single character after point to the search string
(analogous to C-w, but less greedy).  Even more useful
is my C-b which removes a single character (because
C-w is sometimes _too_ greedy).

Regards,
  David V.





reply via email to

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