GNU bug report logs - #51561
29.0.50; overlay keymaps do not respect mouse-1 logic

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51561 in the body.
You can then email your comments to 51561 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51561; Package emacs. (Tue, 02 Nov 2021 02:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars Ingebrigtsen <larsi <at> gnus.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 02 Nov 2021 02:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; overlay keymaps do not respect mouse-1 logic
Date: Tue, 02 Nov 2021 03:39:59 +0100
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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51561; Package emacs. (Tue, 02 Nov 2021 02:50:02 GMT) Full text and rfc822 format available.

Message #8 received at 51561 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 51561 <at> debbugs.gnu.org
Subject: Re: bug#51561: 29.0.50; overlay keymaps do not respect mouse-1 logic
Date: Tue, 02 Nov 2021 03:48:54 +0100
Lars Ingebrigtsen <larsi <at> 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




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 02 Nov 2021 02:50:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 51561 <at> debbugs.gnu.org and Lars Ingebrigtsen <larsi <at> gnus.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 02 Nov 2021 02:50:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51561; Package emacs. (Tue, 02 Nov 2021 04:31:01 GMT) Full text and rfc822 format available.

Message #15 received at 51561 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, "51561 <at> debbugs.gnu.org"
 <51561 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#51561: 29.0.50; overlay keymaps do not respect
 mouse-1 logic
Date: Tue, 2 Nov 2021 04:30:19 +0000
> 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?




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 30 Nov 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 200 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.