mu4e/view: Restore URL activation, TAB

Make URL activation work again (with mouse, M-RET), and TAB in
gnus-view.

Fixes: #1946.
This commit is contained in:
Dirk-Jan C. Binnema
2021-03-16 17:13:36 +02:00
parent 08890dee2d
commit 7f244ee454
3 changed files with 12 additions and 34 deletions

View File

@ -478,10 +478,10 @@ list."
"A map of some number->url so we can jump to url by number.")
(put 'mu4e~view-link-map 'permanent-local t)
(defvar mu4e-view-clickable-urls-keymap
(defvar mu4e-view-active-urls-keymap
(let ((map (make-sparse-keymap)))
(define-key map [mouse-1] 'mu4e~view-browse-url-from-binding)
(define-key map [?\M-\r] 'mu4e~view-browse-url-from-binding)
(define-key map (kbd "M-<return>") 'mu4e~view-browse-url-from-binding)
map)
"Keymap used for the urls inside the body.")
@ -514,12 +514,11 @@ Meant to be evoked from interactive commands."
(get-text-property
(posn-point posn)
prop
(window-buffer (posn-window posn)))
))
(window-buffer (posn-window posn)))))
(get-text-property (point) prop)))
;; this is fairly simplistic...
(defun mu4e~view-make-urls-clickable ()
(defun mu4e~view-activate-urls ()
"Turn things that look like URLs into clickable things.
Also number them so they can be opened using `mu4e-view-go-to-url'."
(let ((num 0))
@ -539,7 +538,7 @@ Also number them so they can be opened using `mu4e-view-go-to-url'."
`(face mu4e-link-face
mouse-face highlight
mu4e-url ,url
keymap ,mu4e-view-clickable-urls-keymap
keymap ,mu4e-view-active-urls-keymap
help-echo
"[mouse-1] or [M-RET] to open the link"))
(overlay-put ov 'after-string