GNU bug report logs -
#71
FW: mouse click on an overlay, using overlay `keymap' property
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Fri, 21 Mar 2008 17:20:08 UTC
Severity: normal
Merged with 102
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71 in the body.
You can then email your comments to 71 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#71
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Drew Adams" <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
No one was able to explain this on emacs-devel. The only
replies there indicate that this is an Emacs bug: `keymap'
property doesn't work on an overlay, at least when there is
also a `display' property present.
-----Original Message-----
From: Drew Adams Sent: Sunday, March 16, 2008 4:21 PM
To: 'emacs- devel'
Could someone please explain what's happening here, and why?
How can I get
the overlay's keymap to be in effect over all of the visual
(displayed) area
of the overlay?
(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 probably not understanding this well - help appreciated.
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 I'm specifically asking about overlays here, not
text properties.
I know how to create clickable text using text properties.]
Merged 71 102.
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> emacsbugs.donarmstrong.com
.
(Wed, 16 Apr 2008 13:25:06 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to "Drew Adams" <drew.adams <at> oracle.com>
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> emacsbugs.donarmstrong.com
.
(Sun, 20 Apr 2008 13:45:04 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <don <at> donarmstrong.com>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Sun, 18 May 2008 14:24:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 17 years and 36 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.