From: Juri Linkov <juri@jurta.org>
Subject: Re: @#$! new behavior of C-b & C-f in i-search
Date: Mon, 07 Jun 2004 09:43:45 +0300 [thread overview]
Message-ID: <87pt8brhpf.fsf@mail.jurta.org> (raw)
In-Reply-To: <87k6z2jjm5.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 24 May 2004 11:48:55 +0300")
Juri Linkov <juri@jurta.org> writes:
> When C-f is typed in the end of the isearch minibuffer (activated by
> M-e) it could append characters from the isearch buffer to the
> search string in the minibuffer.
Since no one objected, I propose the following patch. Generally, this
means that to pull characters into the search string instead of typing
C-s C-f C-f ... C-f C-s
to type one key more:
C-s M-e C-f C-f ... C-f C-s
But there is another small difference: the cursor is moved into the
minibuffer. So separate keybindings for `isearch-yank-char' and
`isearch-del-char' are still needed. I propose to bind them to
C-M-w and C-M-y, because these keybindings are absolutely harmless
(unlike other proposals) and have good mnemonics being bound to the
same keys as `isearch-yank-word-or-char' and `isearch-yank-line'.
For keyboards where C-M-w and C-M-y are not easy to type, the
alternative is `isearch-yank-char-in-minibuffer' accessible by M-e.
Index: lisp/isearch.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.228
diff -u -w -b -r1.228 isearch.el
--- lisp/isearch.el 6 Jun 2004 13:57:39 -0000 1.228
+++ lisp/isearch.el 7 Jun 2004 00:59:38 -0000
@@ -294,6 +294,8 @@
(define-key map " " 'isearch-whitespace-chars)
(define-key map [?\S-\ ] 'isearch-whitespace-chars)
+ (define-key map "\C-\M-w" 'isearch-del-char)
+ (define-key map "\C-\M-y" 'isearch-yank-char)
(define-key map "\C-w" 'isearch-yank-word-or-char)
(define-key map "\C-y" 'isearch-yank-line)
@@ -343,11 +345,14 @@
(define-key map "\M-\t" 'isearch-complete-edit)
(define-key map "\C-s" 'isearch-forward-exit-minibuffer)
(define-key map "\C-r" 'isearch-reverse-exit-minibuffer)
+ (define-key map "\C-f" 'isearch-yank-char-in-minibuffer)
+ (define-key map [right] 'isearch-yank-char-in-minibuffer)
map)
"Keymap for editing isearch strings in the minibuffer.")
@@ -1126,10 +1131,21 @@
(goto-char isearch-other-end))
(buffer-substring-no-properties (point) (funcall jumpform)))))
+(defun isearch-yank-char-in-minibuffer (&optional arg)
+ "Pull next character from isearch buffer into end of search string in minibuffer."
+ (interactive "p")
+ (if (eobp)
+ (insert
+ (save-excursion
+ (set-buffer (cadr (buffer-list)))
+ (buffer-substring-no-properties
+ (point) (progn (forward-char arg) (point)))))
+ (forward-char arg)))
+
(defun isearch-yank-char (&optional arg)
"Pull next character from buffer into search string."
(interactive)
(isearch-yank-internal (lambda () (forward-char 1) (point))))
--
Juri Linkov
http://www.jurta.org/emacs/
next prev parent reply other threads:[~2004-06-07 6:43 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-18 4:51 @#$! new behavior of C-b & C-f in i-search Miles Bader
2004-05-18 0:15 ` Karl Fogel
2004-05-18 6:05 ` Juri Linkov
2004-05-18 7:06 ` Kai Grossjohann
2004-05-18 7:16 ` David Kastrup
2004-05-19 5:22 ` Karl Eichwalder
2004-05-20 6:03 ` Juri Linkov
2004-05-20 7:29 ` David Kastrup
2004-05-20 8:35 ` Kenichi Handa
2004-05-20 10:48 ` David Kastrup
2004-05-20 11:31 ` Kenichi Handa
2004-05-20 17:34 ` Kevin Rodgers
2004-05-20 18:02 ` David Kastrup
2004-05-20 20:08 ` Peter Lee
2004-05-24 8:48 ` Juri Linkov
2004-06-07 6:43 ` Juri Linkov [this message]
2004-06-07 19:17 ` Richard Stallman
2004-06-11 8:17 ` Juri Linkov
2004-06-11 8:35 ` Kim F. Storm
2004-06-11 8:48 ` Alan Mackenzie
2004-06-12 1:50 ` Richard Stallman
2004-05-18 12:27 ` Robert J. Chassell
2004-05-19 1:26 ` Richard Stallman
2004-05-19 6:32 ` @#$! new behavior of C-b & C-f in i-searchi Alan Mackenzie
2004-05-19 8:33 ` @#$! new behavior of C-b & C-f in i-search Juri Linkov
2004-05-19 9:06 ` Miles Bader
2004-05-19 9:32 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pt8brhpf.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.