all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Miles <numbchild@gmail.com>
To: Emacs Help <help-gnu-emacs@gnu.org>
Subject: [QUESTION] Mouse click on an text-property object displayed as image not working
Date: Wed, 13 Jan 2021 02:40:07 +0000	[thread overview]
Message-ID: <VI1PR1001MB10702DFF4262CB43F414F9C7A3A90@VI1PR1001MB1070.EURPRD10.PROD.OUTLOOK.COM> (raw)

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]


Here is my Emacs package https://github.com/stardiviner/org-link-beautify

I got an problem on defining keybinding mouse left click on text-property object
which is display as image. The following code can't work when click on the
preview image. But it works fine if the text-property object is not image.

#+begin_src emacs-lisp
(defun org-link-beautify--add-keymap (start end)
  "Add keymap on link text-property. between START and END."
  (put-text-property start end 'keymap org-link-beautify-keymap))

(define-key org-link-beautify-keymap (kbd "RET") 'org-open-at-point)
(define-key org-link-beautify-keymap [mouse-1] 'org-open-at-point)
(define-key org-link-beautify-keymap (kbd "<mouse-1>") 'org-open-at-point)
#+end_src

The code of displaying image in text-property is here:

https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L291

And here is background info of the user submitted issue, there is a gif showing this case.

https://github.com/stardiviner/org-link-beautify/issues/7

-- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2021-01-13  2:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  2:40 Christopher Miles [this message]
2021-01-14 11:12 ` [QUESTION] Mouse click on an text-property object displayed as image not working Michael Heerdegen
2021-01-14 15:03   ` Christopher Miles
2021-01-14 17:18     ` Michael Heerdegen
2021-01-16  4:35       ` [SOLVED] " Christopher Miles

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=VI1PR1001MB10702DFF4262CB43F414F9C7A3A90@VI1PR1001MB1070.EURPRD10.PROD.OUTLOOK.COM \
    --to=numbchild@gmail.com \
    --cc=help-gnu-emacs@gnu.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.