From: Juri Linkov <juri@jurta.org>
Subject: isearch-yank-char
Date: Mon, 26 Apr 2004 07:42:08 +0300 [thread overview]
Message-ID: <874qr7l59b.fsf@mail.jurta.org> (raw)
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.
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").
Another example where this key binding is needed is Emacs modes which
give word syntax to non-word characters. For example, in Info mode
it is impossible to grab a function or variable name into search
string as a word, because it grabs the apostrophe character used
for quoting as part of the function name.
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.
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'.
Index: lisp/isearch.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.226
diff -u -r1.226 isearch.el
--- lisp/isearch.el 4 Mar 2004 16:54:08 -0000 1.226
+++ lisp/isearch.el 26 Apr 2004 04:34:14 -0000
@@ -294,7 +294,8 @@
(define-key map " " 'isearch-whitespace-chars)
(define-key map [?\S-\ ] 'isearch-whitespace-chars)
- (define-key map "\C-w" 'isearch-yank-word-or-char)
+ (define-key map "\C-f" 'isearch-yank-char)
+ (define-key map "\C-w" 'isearch-yank-word)
(define-key map "\C-y" 'isearch-yank-line)
--
Juri Linkov
http://www.jurta.org/emacs/
next reply other threads:[~2004-04-26 4:42 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-26 4:42 Juri Linkov [this message]
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 ` 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=874qr7l59b.fsf@mail.jurta.org \
--to=juri@jurta.org \
/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).