From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: my search/paste idiom not supported in emacs Date: Thu, 30 Dec 2010 10:39:06 +0100 Message-ID: <87d3ojob0l.fsf@member.fsf.org> References: <3269D978-6F36-493B-91B2-FE9EC9A6DA17@mac.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1293702000 10829 80.91.229.12 (30 Dec 2010 09:40:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Dec 2010 09:40:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 30 10:39:56 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 1PYEzE-0005l5-4U for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Dec 2010 10:39:56 +0100 Original-Received: from localhost ([127.0.0.1]:43192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYEzD-0002Lo-A6 for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Dec 2010 04:39:55 -0500 Original-Received: from [140.186.70.92] (port=40659 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYEyd-0002Lh-O5 for help-gnu-emacs@gnu.org; Thu, 30 Dec 2010 04:39:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYEyc-0001kZ-P6 for help-gnu-emacs@gnu.org; Thu, 30 Dec 2010 04:39:19 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:41016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PYEyc-0001kD-JW for help-gnu-emacs@gnu.org; Thu, 30 Dec 2010 04:39:18 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PYEya-0005Zv-QT for help-gnu-emacs@gnu.org; Thu, 30 Dec 2010 10:39:16 +0100 Original-Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Dec 2010 10:39:16 +0100 Original-Received: from tassilo by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Dec 2010 10:39:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:kjmQ6lUl2AimrzHt7YL3sxcZWB0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:77961 Archived-At: 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. > 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--- Bye, Tassilo