unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@floss.red-bean.com>
Cc: emacs-devel@gnu.org
Subject: Re: isearch-yank-char
Date: 25 Apr 2004 18:03:29 -0500	[thread overview]
Message-ID: <874qr7ek3i.fsf@floss.red-bean.com> (raw)
In-Reply-To: <874qr7l59b.fsf@mail.jurta.org>

Juri Linkov <juri@jurta.org> writes:
> There is an inevitable need for a key binding for isearch-yank-char.
> 
> The current C-w key binding for isearch-yank-word-or-char tries
> to decide whether the user wants a character or a word, but it
> often fails, because it is impossible to predict what the user wants.

For more of the history behind this, see

   http://mail.gnu.org/archive/html/emacs-devel/2001-04/threads.html#00001

The archive seems not to have caught every mail in the thread,
unfortunately.  For example, Richard Stallman sent this mail, but it
does not appear to be in the archive:

  | From: Richard Stallman <rms@gnu.org>
  | Subject: Re: isearch C-o patch (post-freeze resubmission)
  | To: storm@cua.dk
  | CC: kfogel@red-bean.com, emacs-devel@gnu.org
  | Date: Thu, 29 Nov 2001 12:18:25 -0700 (MST)
  | Reply-to: rms@gnu.org
  | 
  |     However, I would much rather change the behaviour of C-w so that it
  |     copies a `word' if it is on a `word character' and a single
  |     character otherwise.  Then I could C-w C-w C-w to copy
  |     word+= into the minibuffer (and use backspace if I got too much).
  | 
  | This seems like an idea worth trying.  Would you like to do it?

I don't know what else might be missing (haven't done a careful
survey), but anyway I think what's in the archive is complete enough
to give all relevant context.

> The need to grab a part of a word into search string is valid for many
> languages, even for English, for example, to search all forms of a
> word (e.g. singular and plural forms, inflected verbs, etc.) by
> grabbing the word root from the buffer and omitting word endings
> (such as "-s", "-ing", "-ed").

Yes.  At first, I thought having C-w be more sophisticated would be
enough, but in practice, finer-grained control is often necessary.

> I guess that isearch-yank-char has no key binding yet, because it is
> difficult to choose a good one.  I looked at all possible key bindings,
> and it seems that the best key binding is C-f.  It is most suitable
> semantically: normally, C-f runs forward-char, and isearch-yank-char
> has a similar functionality by operating on characters.

The original binding was C-o, but C-f seems like a better choice, for
the reasons you give.

> But most importantly, C-f is the most backward compatible key binding,
> because when the user types C-f without leaving isearch mode with the
> intention to move the point right, nothing bad happens: the user
> simply types RET or any other non-isearch key to finish isearch, and
> the point remains exactly at the same position where the user wanted
> to move it!  In other words, `C-s ...  C-f RET' is equivalent to
> `C-s ...  RET C-f'.

A thought: can we then bind C-b to *lose* a single character from the
search string?  The same logic applies to both C-f and C-b, and wow,
it sure would be convenient to have something finer than Backspace
(since Backspace usually loses too much!).

Of course, the patch for that would be a bit more complex than just
binding a key.  But if people think it is a good idea, I will be
happy to write it.

In any case, binding C-f to isearch-yank-char seems like a fine idea.

-Karl

  reply	other threads:[~2004-04-25 23:03 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 ` Karl Fogel [this message]
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                                   ` isearch-yank-char Juri Linkov
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=874qr7ek3i.fsf@floss.red-bean.com \
    --to=kfogel@floss.red-bean.com \
    --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).