Subject: bug#51561: [External] : bug#51561: 29.0.50; overlay keymaps do not respect mouse-1 logic

From: Drew Adams <[email-masked]>
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?