]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/shr.el (shr-copy-url): Also copy the image URL.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 5 Aug 2014 18:15:03 +0000 (20:15 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 5 Aug 2014 18:15:03 +0000 (20:15 +0200)
* lisp/net/shr.el (shr-copy-url): Also copy the image URL.

lisp/ChangeLog
lisp/net/shr.el

index aec717a159a54e5f7f105127a2a8c4c8f7c09c5b..5ec506b63b0d438de12d6c7a00be6a4170d51537 100644 (file)
@@ -1,3 +1,7 @@
+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
index 58442575ad2a9768bf8ae6978f75f0c0e135282a..5e2e1eadf862c3825f7a2ed89cc12a49f94595ab 100644 (file)
@@ -214,12 +214,16 @@ DOM should be a parse tree as generated by
              (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"))