* bug#51561: 29.0.50; overlay keymaps do not respect mouse-1 logic
@ 2021-11-02 2:39 Lars Ingebrigtsen
2021-11-02 2:48 ` Lars Ingebrigtsen
2021-11-02 4:30 ` bug#51561: [External] : " Drew Adams
0 siblings, 2 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-02 2:39 UTC (permalink / raw)
To: 51561
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 (build 107, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0)
of 2021-10-31 built on elva
Repository revision: b75e79138cbafd804f83bcea96c0754f468a8075
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux bookworm/sid
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#51561: 29.0.50; overlay keymaps do not respect mouse-1 logic
2021-11-02 2:39 bug#51561: 29.0.50; overlay keymaps do not respect mouse-1 logic Lars Ingebrigtsen
@ 2021-11-02 2:48 ` Lars Ingebrigtsen
2021-11-02 4:30 ` bug#51561: [External] : " Drew Adams
1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-02 2:48 UTC (permalink / raw)
To: 51561
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Putting follow-link in a keymap is supposed to make
> mouse-1-click-follows-link do its thing.
No, it isn't. You have to put this incantation into an overlay for it
to be a link. Which is slightly logical, I guess?
(overlay-put o 'follow-link 'mouse-face)
(overlay-put o 'mouse-face 'highlight)
So there's nothing to fix here, I think.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#51561: [External] : bug#51561: 29.0.50; overlay keymaps do not respect mouse-1 logic
2021-11-02 2:39 bug#51561: 29.0.50; overlay keymaps do not respect mouse-1 logic Lars Ingebrigtsen
2021-11-02 2:48 ` Lars Ingebrigtsen
@ 2021-11-02 4:30 ` Drew Adams
1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2021-11-02 4:30 UTC (permalink / raw)
To: Lars Ingebrigtsen, 51561@debbugs.gnu.org
> 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?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-02 4:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-02 2:39 bug#51561: 29.0.50; overlay keymaps do not respect mouse-1 logic Lars Ingebrigtsen
2021-11-02 2:48 ` Lars Ingebrigtsen
2021-11-02 4:30 ` bug#51561: [External] : " Drew Adams
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.