From: Tassilo Horn <tassilo@member.fsf.org>
To: help-gnu-emacs@gnu.org
Subject: Re: my search/paste idiom not supported in emacs
Date: Thu, 30 Dec 2010 10:39:06 +0100 [thread overview]
Message-ID: <87d3ojob0l.fsf@member.fsf.org> (raw)
In-Reply-To: 3269D978-6F36-493B-91B2-FE9EC9A6DA17@mac.com
Perry Wagle <wagle@mac.com> writes:
Hi Perry,
> In xemacs, if I double click on a word, the word is highlighted. If I
> then press control-s for search, and click the middle mouse button
> *without moving the mouse*, I will paste that word into the search
> string, and all is good.
>
> Emacs, on the other hand, does not support this idiom. For some
> reason, the middle mouse button *ABORTS* the search mode, and then
> pastes the word under the mouse. Why would you want that?
Hm, middle mouse button is "paste the primary selection at this
position" in almost any X application.
> This idiom alone has kept me using xemacs for over a decade. I'd like
> to switch to emacs now.
>
> Can I fix this easily with option-setting, or does it require me to
> hack and add the correct behavior?
Simply add a keybinding for that:
--8<---------------cut here---------------start------------->8---
(define-key isearch-mode-map (kbd "<mouse-2>")
'isearch-yank-x-selection)
--8<---------------cut here---------------end--------------->8---
If you don't like how that expands the region (including highlighting),
then use something like that to deactivate the mark before:
--8<---------------cut here---------------start------------->8---
(define-key isearch-mode-map (kbd "<mouse-2>")
(lambda ()
(interactive)
(deactivate-mark)
(isearch-yank-x-selection)))
--8<---------------cut here---------------end--------------->8---
Bye,
Tassilo
next prev parent reply other threads:[~2010-12-30 9:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-30 0:39 my search/paste idiom not supported in emacs Perry Wagle
2010-12-30 9:39 ` Tassilo Horn [this message]
2010-12-30 16:23 ` Perry Wagle
2010-12-30 10:01 ` Peter Dyballa
2010-12-30 16:26 ` Perry Wagle
2010-12-30 15:36 ` Kenneth Goldman
[not found] <mailman.4.1293700342.31316.help-gnu-emacs@gnu.org>
2010-12-30 9:35 ` Joost Kremers
2011-01-03 4:36 ` Stefan Monnier
2011-01-05 8:56 ` Perry Wagle
2011-02-09 3:33 ` Perry Wagle
2011-02-09 9:18 ` Gary
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=87d3ojob0l.fsf@member.fsf.org \
--to=tassilo@member.fsf.org \
--cc=help-gnu-emacs@gnu.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.