all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	"51561@debbugs.gnu.org" <51561@debbugs.gnu.org>
Subject: bug#51561: [External] : bug#51561: 29.0.50; overlay keymaps do not respect mouse-1 logic
Date: Tue, 2 Nov 2021 04:30:19 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488431ED5F6BB83AFD04B2FF38B9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <877ddrnuv4.fsf@gnus.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?





      parent reply	other threads:[~2021-11-02  4:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB5488431ED5F6BB83AFD04B2FF38B9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=51561@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.