summaryrefslogtreecommitdiff
path: root/lisp/gnus/mm-decode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/mm-decode.el')
-rw-r--r--lisp/gnus/mm-decode.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index b025f7cc60..948b2a2fd1 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1809,6 +1809,7 @@ If RECURSIVE, search recursively."
(libxml-parse-html-region (point-min) (point-max))))
(unless (bobp)
(insert "\n"))
+ (mm-convert-shr-links)
(mm-handle-set-undisplayer
handle
`(lambda ()
@@ -1816,6 +1817,20 @@ If RECURSIVE, search recursively."
(delete-region ,(point-min-marker)
,(point-max-marker))))))))
+(defun mm-convert-shr-links ()
+ (let ((start (point-min))
+ end)
+ (while (and start
+ (< start (point-max)))
+ (when (setq start (text-property-not-all start (point-max) 'shr-url nil))
+ (setq end (next-single-property-change start 'shr-url nil (point-max)))
+ (widget-convert-button
+ 'url-link start end
+ :help-echo (get-text-property start 'help-echo)
+ :keymap shr-map
+ (get-text-property start 'shr-url))
+ (setq start end)))))
+
(defun mm-handle-filename (handle)
"Return filename of HANDLE if any."
(or (mail-content-type-get (mm-handle-type handle)