From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#10022: 24.0.91; `isearch-mouse-2' relies on `x-get-selection' - NG for Windows etc. Date: Fri, 11 Nov 2011 17:01:06 -0800 Message-ID: <055102FB22B94F7E8A0B265429BF6E09@us.oracle.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 1321059715 3690 80.91.229.12 (12 Nov 2011 01:01:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Nov 2011 01:01:55 +0000 (UTC) To: 10022@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 12 02:01:51 2011 Return-path: Envelope-to: geb-bug-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 1RP1yg-0002zo-S0 for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Nov 2011 02:01:51 +0100 Original-Received: from localhost ([::1]:34546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RP1yg-0007sY-5b for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Nov 2011 20:01:50 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:53218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RP1yc-0007sG-9l for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 20:01:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RP1yZ-0007YG-Py for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 20:01:46 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RP1yZ-0007Xs-O8 for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 20:01:43 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RP1ys-00044O-Fn for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 20:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Nov 2011 01:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10022 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.132105970515617 (code B ref -1); Sat, 12 Nov 2011 01:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Nov 2011 01:01:45 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RP1ya-00043q-Nv for submit@debbugs.gnu.org; Fri, 11 Nov 2011 20:01:45 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RP1yX-00043c-PI for submit@debbugs.gnu.org; Fri, 11 Nov 2011 20:01:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RP1y8-0007Bs-Ip for submit@debbugs.gnu.org; Fri, 11 Nov 2011 20:01:17 -0500 Original-Received: from lists.gnu.org ([140.186.70.17]:47148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RP1y8-0007Bg-E7 for submit@debbugs.gnu.org; Fri, 11 Nov 2011 20:01:16 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:53138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RP1y7-0007qv-Dd for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 20:01:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RP1y5-00079m-T3 for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 20:01:15 -0500 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:30004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RP1y5-000793-Kp for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 20:01:13 -0500 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pAC11BwB015797 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 12 Nov 2011 01:01:12 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pAC11B9f013483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 12 Nov 2011 01:01:11 GMT Original-Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pAC115Dc004991 for ; Fri, 11 Nov 2011 19:01:06 -0600 Original-Received: from dradamslap1 (/10.159.61.9) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 11 Nov 2011 17:01:05 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acyg1o5z0L26rrt3QeC9miKnqjHJfg== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.4EBDC558.0085,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 11 Nov 2011 20:02:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:53823 Archived-At: No, I am not certain this is a bug - you decide. In `isearch-mode-map', `isearch-mouse-2' is bound to `mouse-2' and `down-mouse-2' is bound to nil. `isearch-mouse-2': (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) (when (functionp binding) (call-interactively binding))))) I globally bind `down-mouse-2' to a command of mine, `mouse-flash-position-or-M-x', which highlights the yank position (or calls `M-x' in the echo area). The highlighting intentionally happens only while the mouse button is pressed. Because of this global binding, I need to change the `isearch-mode-map' binding of `down-mouse-2' to `ignore'. Dunno whether a binding of `ignore' makes better sense for vanilla Emacs here too (e.g., in case someone binds `down-mouse-2' globally). However, that is not sufficient, to be able to use `mouse-2' with Isearch. Perhaps because of some selection setting I have, with my setup (on MS Windows) `x-get-selection' just returns nil. That means that `isearch-mouse-2' barfs when it calls `isearch-yank-selection'. That function tries to yank the string returned by `x-get-selection', but that function returns nil, not a string. The PRIMARY selection is not set, at least in my context. This function apparently depend ons it being set. Seems like a bug, to me. To fix this, I use a hack like this in `isearch-mouse-2'. Dunno what the right fix for vanilla Emacs would be. (when (and transient-mark-mode (/= (region-beginning) (region-end))) (x-set-selection 'PRIMARY (buffer-substring-no-properties (region-beginning) (region-end))) (deactivate-mark) (isearch-yank-x-selection)) Consider this only an FYI. I suspect there is a problem, and that the `isearch-mouse-2' code should not depend on the PRIMARY selection being set, but you decide. In GNU Emacs 24.0.91.1 (i386-mingw-nt5.1.2600) of 2011-11-07 on MARVIN Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.6) --no-opt --cflags -I"D:/devel/emacs/libs/libXpm-3.5.8/include" -I"D:/devel/emacs/libs/libXpm-3.5.8/src" -I"D:/devel/emacs/libs/libpng-dev_1.4.3-1/include" -I"D:/devel/emacs/libs/zlib-dev_1.2.5-2/include" -I"D:/devel/emacs/libs/giflib-4.1.4-1/include" -I"D:/devel/emacs/libs/jpeg-6b-4/include" -I"D:/devel/emacs/libs/tiff-3.8.2-1/include" -I"D:/devel/emacs/libs/gnutls-2.10.1/include" --ldflags -L"D:/devel/emacs/libs/gnutls-2.10.1/lib"'