[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix mouse click on flymake
From: |
Eli Zaretskii |
Subject: |
Re: [PATCH] Fix mouse click on flymake |
Date: |
Thu, 23 Jan 2025 13:04:50 +0200 |
> Date: Tue, 21 Jan 2025 18:37:59 +0100
> From: Ergus <spacibba@aol.com>
> CC: juri@linkov.net, sbaugh@janestreet.com
>
> In one of my previous emails I shared this code:
>
> ```
> (defun margin-command ()
> (interactive)
> (message "Clicked!!"))
>
> (defvar-keymap margin-keymap
> :doc "Keymap margin."
> "<mouse-1>" #'margin-command)
>
> (progn
> (setq left-margin-width 1)
> (dolist (win (get-buffer-window-list))
> (set-window-buffer win (current-buffer)))
>
> (defvar margin-overlay (make-overlay (point) (point)))
>
> (move-overlay margin-overlay (point) (point))
> (overlay-put margin-overlay 'before-string
> (propertize " " 'display
> (list '(margin left-margin)
> (propertize "b"
> 'face 'error
> 'mouse-face 'highlight
> 'help-echo "HEE error message"
> 'keymap margin-keymap)))))
>
> ```
>
> Is this enough?
Yes, thanks.
AFAICT, your key binding is incorrect: you need to use
"<left-margin> <mouse-1>" instead. IOW, the below works for me:
(defun margin-command ()
(interactive)
(message "Clicked!!"))
(defvar-keymap margin-keymap
:doc "Keymap margin."
"<left-margin> <mouse-1>" #'margin-command)
(progn
(setq left-margin-width 1)
(dolist (win (get-buffer-window-list))
(set-window-buffer win (current-buffer)))
(defvar margin-overlay (make-overlay (point) (point)))
(move-overlay margin-overlay (point) (point))
(overlay-put margin-overlay 'before-string
(propertize " " 'display
(list '(margin left-margin)
(propertize "b"
'face 'error
'mouse-face 'highlight
'help-echo "HEE error message"
'keymap margin-keymap)))))
- Re: [PATCH] Fix mouse click on flymake, (continued)
- Re: [PATCH] Fix mouse click on flymake, Eli Zaretskii, 2025/01/19
- Re: [PATCH] Fix mouse click on flymake, Juri Linkov, 2025/01/19
- Re: [PATCH] Fix mouse click on flymake, Ergus, 2025/01/19
- Re: [PATCH] Fix mouse click on flymake, Juri Linkov, 2025/01/19
- Re: [PATCH] Fix mouse click on flymake, Ergus, 2025/01/19
- Message not available
- Re: [PATCH] Fix mouse click on flymake, Ergus, 2025/01/20
- Re: [PATCH] Fix mouse click on flymake, Juri Linkov, 2025/01/20
- Re: [PATCH] Fix mouse click on flymake, Ergus, 2025/01/20
- Re: [PATCH] Fix mouse click on flymake, Eli Zaretskii, 2025/01/21
- Re: [PATCH] Fix mouse click on flymake, Ergus, 2025/01/21
- Re: [PATCH] Fix mouse click on flymake,
Eli Zaretskii <=
- Re: [PATCH] Fix mouse click on flymake, Ergus, 2025/01/23
- Re: [PATCH] Fix mouse click on flymake, Eli Zaretskii, 2025/01/24
- Re: [PATCH] [UPDATE] Fix mouse click on flymake, Ergus, 2025/01/24
- Re: [PATCH] [UPDATE2] Fix mouse click on flymake, Ergus, 2025/01/24
- Re: [PATCH] [UPDATE2] Fix mouse click on flymake, Juri Linkov, 2025/01/25
- Re: [PATCH] [UPDATE3] Fix mouse click on flymake, Ergus, 2025/01/25
- Re: [PATCH] Fix mouse click on flymake, Ergus, 2025/01/19