+2014-08-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * net/shr.el (shr-copy-url): Also copy the image URL.
+
2014-08-05 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-cache.el (tramp-flush-file-function): Suppress function
(overlay-put overlay 'before-string nil))))
(forward-line 1)))))
-(defun shr-copy-url ()
+(defun shr-copy-url (&optional image-url)
"Copy the URL under point to the kill ring.
+If IMAGE-URL (the prefix) is non-nil, or there is no link under
+point, but there is an image under point then copy the URL of the
+image under point instead.
If called twice, then try to fetch the URL and see whether it
redirects somewhere else."
- (interactive)
- (let ((url (get-text-property (point) 'shr-url)))
+ (interactive "P")
+ (let ((url (or (get-text-property (point) 'shr-url)
+ (get-text-property (point) 'image-url))))
(cond
((not url)
(message "No URL under point"))