From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: keymap property ignored for mouse click on overlay Date: Sun, 30 Mar 2008 11:24:44 -0700 Message-ID: <000b01c89293$540969d0$0200a8c0@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: ger.gmane.org 1206901589 24357 80.91.229.12 (30 Mar 2008 18:26:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 18:26:29 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 30 20:27:01 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jg2ED-00081I-RB for ged-emacs-devel@m.gmane.org; Sun, 30 Mar 2008 20:26:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg2Dc-0005kl-18 for ged-emacs-devel@m.gmane.org; Sun, 30 Mar 2008 14:25:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jg2DY-0005kF-2I for emacs-devel@gnu.org; Sun, 30 Mar 2008 14:25:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jg2DW-0005jt-Ho for emacs-devel@gnu.org; Sun, 30 Mar 2008 14:25:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg2DW-0005jp-9U for emacs-devel@gnu.org; Sun, 30 Mar 2008 14:25:18 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jg2DW-0005wp-3m for emacs-devel@gnu.org; Sun, 30 Mar 2008 14:25:18 -0400 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Jg2DV-0004Ij-Sw for emacs-pretest-bug@gnu.org; Sun, 30 Mar 2008 14:25:17 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Jg2DS-0005wP-OG for emacs-pretest-bug@gnu.org; Sun, 30 Mar 2008 14:25:17 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jg2DS-0005w7-DA for emacs-pretest-bug@gnu.org; Sun, 30 Mar 2008 14:25:14 -0400 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m2UIPBeo014217 for ; Sun, 30 Mar 2008 12:25:12 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m2UGDGib007003 for ; Sun, 30 Mar 2008 12:25:11 -0600 Original-Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3631337261206901467; Sun, 30 Mar 2008 11:24:27 -0700 Original-Received: from dradamslap1 (/141.144.64.157) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 30 Mar 2008 11:24:26 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AciSk1OlBYhp0Ue3ROilYhdAPHwfXQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:93918 gmane.emacs.pretest.bugs:21802 Archived-At: emacs -Q (setq foo-map (make-sparse-keymap)) (define-key foo-map [mouse-2] 'bar) (defun foo (beg end) (interactive "r") (let ((overlay (make-overlay beg end))) (overlay-put overlay 'display (propertize "xxxxxxxxx" 'face 'font-lock-constant-face)) (overlay-put overlay 'keymap foo-map))) (defun bar (event) (interactive "e") (message "BAR")) Here's some text: aaaaaaaaaaaaaaaaaaaaaaa Select one or more of the a's and do M-x foo, to apply the overlay to just those a's. Put point somewhere outside the displayed "xxxxxxxxx" overlay. Click mouse-2 anywhere on the displayed "xxxxxxxxx". What happens, it seems, is that, since point is not on the a's that have the overlay, keymap foo-map doesn't apply. Clicking mouse-2 therefore just calls the default mouse-2 binding, e.g. mouse-yank-at-click. That sets point so that it is at the beginning of the overlaid text, so that a second mouse-2 click on the displayed "xxxxxxxxx" does call bar. If that's what's happening, how can foo be defined so that a first click on the displayed "xxxxxxxxx" calls bar? I'm guessing that the mouse click on the overlay is noted not as being a click on a buffer position that has the overlay but on a buffer position that is under the displayed "xxxxxxxxx" but is actually outside the text that has the overlay. What I'm looking for is for the click to be perceived by Emacs as happening on the overlay, and for the overlay's keymap to apply over the full extent of the overlay, not just at its beginning, causing the overlay's keymap binding to take effect. Note that this is specifically about overlays, not text properties. In GNU Emacs 22.1.90.1 (i386-mingw-nt5.1.2600) of 2008-01-30 on PRETEST Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include'