GNU bug report logs -
#51561
29.0.50; overlay keymaps do not respect mouse-1 logic
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Tue, 2 Nov 2021 02:41:02 UTC
Severity: normal
Tags: notabug
Found in version 29.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #15 received at 51561 <at> debbugs.gnu.org (full text, mbox):
> Putting follow-link in a keymap is supposed to make
> mouse-1-click-follows-link do its thing.
>
> (progn
> (insert "hello")
> (let ((o (make-overlay (- (point) 5) (point))))
> (overlay-put o 'help-echo "Click to hide")
> (overlay-put o 'keymap
> (define-keymap
> [follow-link] 'mouse-face
> [mouse-2] (lambda () (interactive) (message
> "click"))))))
>
> But it doesn't. In GNU Emacs 29.0.50
Is this a regression? If not, what's an equivalent
recipe for actual Emacs releases, i.e. versions that
don't have `define-keymap'?
Maybe this is such a recipe? It seems to show the
same behavior in Emacs 22.3 through 27.2 (the latest
Emacs release):
(progn
(insert "hello")
(let* ((map (make-sparse-keymap))
(o (make-overlay (- (point) 5) (point))))
(define-key map [follow-link] 'mouse-face)
(define-key map [mouse-2] (lambda () (interactive) (message "click")))
(overlay-put o 'help-echo "Click to hide")
(overlay-put o 'keymap map)))
(And same thing with t instead of mouse-face.)
On the other hand, it seems that the Elisp manual
nowhere says anything about links being realized
with overlays.
(elisp) `Clickable Text' says explicitly that
"links" are implemented with text properties (no
mention of overlay properties).
Based on that it seems that what you're looking
for is a new feature. Maybe describe a use case,
to motivate it?
This bug report was last modified 3 years and 201 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.