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: middle mouse paste into isearch minibuffer Date: Wed, 09 Nov 2011 20:09:32 -0800 Message-ID: <45A1589E-53D1-47AA-B13E-8B0870435586@mac.com> References: <888C0416-F844-40E5-AC4D-CE9E15E81278@mac.com> <87wrbtl5rd.fsf@gmail.com> <245928C3-C1D7-4CB5-B64E-DAF7828D1A6B@mac.com> <8739eg1g3b.fsf@gmail.com> <9B70B016-B17B-4134-BB85-9E52CB3CFA3B@mac.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: dough.gmane.org 1320898192 3987 80.91.229.12 (10 Nov 2011 04:09:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Nov 2011 04:09:52 +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 Nov 10 05:09:47 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ROLxN-0006a1-8S for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Nov 2011 05:09:41 +0100 Original-Received: from localhost ([::1]:48911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROLxM-00032p-FW for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Nov 2011 23:09:40 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:52967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROLxI-00032k-VL for help-gnu-emacs@gnu.org; Wed, 09 Nov 2011 23:09:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROLxH-0000xo-R1 for help-gnu-emacs@gnu.org; Wed, 09 Nov 2011 23:09:36 -0500 Original-Received: from nk11p99mm-asmtpout007.mac.com ([17.158.233.228]:37473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROLxH-0000xf-Mu for help-gnu-emacs@gnu.org; Wed, 09 Nov 2011 23:09:35 -0500 Original-Received: from tuple.ftrdhcpuser.net (static-50-43-56-158.bvtn.or.frontiernet.net [50.43.56.158]) by nk11p03mm-asmtp997.mac.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPSA id <0LUF0041AFJWP690@nk11p03mm-asmtp997.mac.com> for help-gnu-emacs@gnu.org; Thu, 10 Nov 2011 04:09:33 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110,1.0.211,0.0.0000 definitions=2011-11-10_01:2011-11-09, 2011-11-09, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=4 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1012030000 definitions=main-1111090306 In-reply-to: <9B70B016-B17B-4134-BB85-9E52CB3CFA3B@mac.com> X-Mailer: Apple Mail (2.1251.1) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) X-Received-From: 17.158.233.228 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82838 Archived-At: Hi Again -- I'm trying to use the mouse to paste to the isearch prompt. The following mod lets me highlight some text with my mouse (or otherwise have it in my kill buffer), then press control-s with my left hand, then middle mouse with my right hand to paste the kill-buffer (?) into the mini-buffer where isearch is waiting for a string to search for. This is without the tedium of carefully moving the mouse way down to the mini-buffer where I don't even want to look, much less navigate the mouse to. My peripheral vision is good enough to see that something is happening down there, which is all the information I need. It's got a problem that I need advice on: (defun isearch-mouse-2 (click) "Handle mouse-2 in Isearch mode. For a click in the echo area, invoke `isearch-yank-x-selection'. Otherwise invoke whatever the calling mouse-2 command sequence is bound to outside of Isearch." (interactive "e") ;; (let* ((w (posn-window (event-start click))) ;; (overriding-terminal-local-map nil) ;; (binding (key-binding (this-command-keys-vector) t))) ;; (if (and (window-minibuffer-p w) ;; (not (minibuffer-window-active-p w))) ; in echo area (isearch-yank-x-selection) (transient-mark-mode) ;; (when (functionp binding) ;; (call-interactively binding))))) ) The problem is with the call to transient-mark-mode. Its my first attempt to fix what I think is a runaway mark-region. If I don't have it, then varying regions of text become highlighted when I move around with repeated pressings of control-s. If I do have it, then I get the other extreme of closing down transient mark mode entirely. The advice I need is this: I think this should work similarly to how keyboard bound people use it. I think that there is some intention that control-s SHOULD move the highlighted region around. But if I double click on or otherwise highlight a region so it can be pasted to isearch mini-buffer, that SHOULDN'T set the mark (I think) for afterwards, when you are control-s'ing around. Is this right? What do I want to do to be consistent with the rest of emacs? How do I do "the right thing"? Do I start using the mark-ring or something? In short, I don't know what all behavior I need to preserve to do this correctly. Thanks! -- Perry PS. If you hate your mouse, please refrain from saying how to do this without the mouse. Its been done, to excess, thanks. The question is "how to integrate the mouse cleanly and consistently in a small way into emacs?".