emacs-devel
[Top][All Lists]
Advanced

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

Re: isearch-yank-char


From: Juri Linkov
Subject: Re: isearch-yank-char
Date: Sun, 02 May 2004 14:32:32 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

address@hidden (Kim F. Storm) writes:
> isearch-yank-word-or-char does a better job than isearch-yank-word
> in cases like the following [] is the cursor location:
>
>         fun1((abc-def-ghi[]));
>         fun2(xyz);
>
> But I'm obviously biased here (as the one who suggested the new C-w
> binding :-)

The main inconvenience of isearch-yank-word-or-char is that its
advancing isearch point is too slow when the user wants to move
the point by words (where the "word" has the same meaning as
in forward-word), or the point is moved too far when the user
wants to search for a part of a word.  But OTOH sometimes calling
isearch-yank-word-or-char repeatedly may be better than switching
between isearch-yank-word and isearch-yank-char.

And I'm still worried that new C-f and C-b key bindings can
be too intrusive for people who expect that they exit isearch.
Especially since I tried now to use old Emacs motion keys
instead of arrow keys, it really seems that they can confuse
if they do something different than exiting isearch.

So given all this, here is another idea:

    (define-key isearch-mode-map "\C-w"    'isearch-yank-word)
    (define-key isearch-mode-map "\C-\M-w" 'isearch-yank-word-or-char)
    (define-key isearch-mode-map "\C-\M-b" 'isearch-del-char)
    (define-key isearch-mode-map "\C-\M-f" 'isearch-yank-char)

These are less probable keys to exit isearch.

And if the goal is to retain backward compatibility as much as possible,
then the following key bindings will satisfy this requirement:

    (define-key isearch-mode-map "\C-w"    'isearch-yank-word-or-char)
    (define-key isearch-mode-map "\M-w"    'isearch-yank-word)
    (define-key isearch-mode-map "\C-\M-w" 'isearch-del-char)
    (define-key isearch-mode-map "\C-\M-y" 'isearch-yank-char)

or

    (define-key isearch-mode-map "\C-w"    'isearch-yank-word-or-char)
    (define-key isearch-mode-map "\M-w"    'isearch-del-char)
    (define-key isearch-mode-map "\C-\M-w" 'isearch-yank-char)
    (define-key isearch-mode-map "\C-\M-y" 'isearch-yank-word)

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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