From: Perry Wagle <wagle@mac.com>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: my search/paste idiom not supported in emacs
Date: Thu, 30 Dec 2010 08:23:54 -0800 [thread overview]
Message-ID: <CC1EA28D-B0DF-48D6-A2DE-FDF10D9B7A3C@mac.com> (raw)
In-Reply-To: <87d3ojob0l.fsf@member.fsf.org>
[-- Attachment #1: Type: text/plain, Size: 1661 bytes --]
On Dec 30, 2010, at 1:39 AM, Tassilo Horn wrote:
> 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.
The position is the search function waiting for a string to look for.
>> 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---
>
WIll try this, thanks!
-- Perry
[-- Attachment #2: Type: text/html, Size: 2815 bytes --]
next prev parent reply other threads:[~2010-12-30 16:23 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
2010-12-30 16:23 ` Perry Wagle [this message]
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
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=CC1EA28D-B0DF-48D6-A2DE-FDF10D9B7A3C@mac.com \
--to=wagle@mac.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tassilo@member.fsf.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.
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).