unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: kfogel@red-bean.com, emacs-devel@gnu.org
Subject: Re: isearch-yank-char
Date: Sun, 02 May 2004 14:32:32 +0300	[thread overview]
Message-ID: <87vfjfjc8f.fsf@mail.jurta.org> (raw)
In-Reply-To: <m3ekq3sypf.fsf@kfs-l.imdomain.dk> (Kim F. Storm's message of "01 May 2004 22:02:20 +0200")

storm@cua.dk (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	other threads:[~2004-05-02 11:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-26  4:42 isearch-yank-char Juri Linkov
2004-04-25 23:03 ` isearch-yank-char Karl Fogel
2004-04-25 23:17   ` isearch-yank-char Karl Fogel
2004-04-26  6:15   ` isearch-yank-char Juri Linkov
2004-04-26 14:10 ` isearch-yank-char Richard Stallman
2004-04-26 22:42 ` isearch-yank-char Stefan Monnier
2004-04-26 23:03   ` isearch-yank-char Miles Bader
2004-04-26 22:48     ` isearch-yank-char Karl Fogel
2004-04-27  8:09       ` isearch-yank-char Juri Linkov
2004-04-27  9:11         ` isearch-yank-char Juri Linkov
2004-04-27  9:41         ` isearch-yank-char David Kastrup
2004-04-27 22:49           ` isearch-yank-char Karl Fogel
2004-04-28  5:04           ` isearch-yank-char Juri Linkov
2004-04-29 22:08             ` isearch-yank-char Karl Fogel
2004-04-30  4:48               ` isearch-yank-char Juri Linkov
2004-04-29 22:53                 ` isearch-yank-char Karl Fogel
2004-04-30  8:27                   ` isearch-yank-char Juri Linkov
2004-04-30 11:23                     ` isearch-yank-char Romain Francoise
2004-04-30 13:47                     ` isearch-yank-char Karl Fogel
2004-04-30 20:55                       ` isearch-yank-char Juri Linkov
2004-04-30 17:34                         ` isearch-yank-char Karl Fogel
2004-05-01  0:15                           ` isearch-yank-char Juri Linkov
2004-04-30 18:57                             ` isearch-yank-char Karl Fogel
2004-05-01  1:04                               ` isearch-yank-char Juri Linkov
2004-05-01 20:02                                 ` isearch-yank-char Kim F. Storm
2004-05-02 11:32                                   ` Juri Linkov [this message]
2004-05-03 12:40                                 ` isearch-yank-char Robert J. Chassell
2004-05-02 11:19                               ` isearch-yank-char Richard Stallman
2004-05-03 19:24                                 ` isearch-yank-char Karl Fogel
2004-05-04 20:08                                   ` isearch-yank-char Richard Stallman
2004-04-30  8:31               ` isearch-yank-char Alan Mackenzie
2004-04-30  9:52                 ` isearch-yank-char Juri Linkov
2004-04-30 10:12                 ` isearch-yank-char Miles Bader
2004-04-30 13:58                 ` isearch-yank-char Karl Fogel
2004-04-27  9:36       ` isearch-yank-char Kim F. Storm
2004-04-28  5:02   ` isearch-yank-char Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vfjfjc8f.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=kfogel@red-bean.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).