From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Perry Wagle Newsgroups: gmane.emacs.help Subject: Re: my search/paste idiom not supported in emacs Date: Thu, 30 Dec 2010 08:23:54 -0800 Message-ID: References: <3269D978-6F36-493B-91B2-FE9EC9A6DA17@mac.com> <87d3ojob0l.fsf@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="Boundary_(ID_rFKuWcANJOvxK/VgsDOPyw)" X-Trace: dough.gmane.org 1293726282 18838 80.91.229.12 (30 Dec 2010 16:24:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Dec 2010 16:24:42 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 30 17:24:38 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PYLIp-0001wK-GG for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Dec 2010 17:24:35 +0100 Original-Received: from localhost ([127.0.0.1]:41867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYLIo-0007JV-DQ for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Dec 2010 11:24:34 -0500 Original-Received: from [140.186.70.92] (port=42774 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYLIT-0007JQ-L2 for help-gnu-emacs@gnu.org; Thu, 30 Dec 2010 11:24:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYLIS-0004EH-JU for help-gnu-emacs@gnu.org; Thu, 30 Dec 2010 11:24:13 -0500 Original-Received: from asmtpout030.mac.com ([17.148.16.105]:46284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PYLIS-0004EB-8o for help-gnu-emacs@gnu.org; Thu, 30 Dec 2010 11:24:12 -0500 Original-Received: from tuple.home (pool-173-50-157-237.ptldor.fios.verizon.net [173.50.157.237]) by asmtp030.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0LE900GRZ1JV0E40@asmtp030.mac.com> for help-gnu-emacs@gnu.org; Thu, 30 Dec 2010 08:23:56 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1010190000 definitions=main-1012300046 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-12-30_08:2010-12-30, 2010-12-30, 1970-01-01 signatures=0 In-reply-to: <87d3ojob0l.fsf@member.fsf.org> X-Mailer: Apple Mail (2.1082) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77970 Archived-At: --Boundary_(ID_rFKuWcANJOvxK/VgsDOPyw) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT On Dec 30, 2010, at 1:39 AM, Tassilo Horn wrote: > Perry Wagle 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 "") > '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 "") > (lambda () > (interactive) > (deactivate-mark) > (isearch-yank-x-selection))) > --8<---------------cut here---------------end--------------->8--- > WIll try this, thanks! -- Perry --Boundary_(ID_rFKuWcANJOvxK/VgsDOPyw) Content-type: text/html; charset=us-ascii Content-transfer-encoding: quoted-printable
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<---------------cu= t here---------------end--------------->8---


WIll= try this, thanks!

-- = Perry

= --Boundary_(ID_rFKuWcANJOvxK/VgsDOPyw)--