aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2014-08-05 20:15:03 +0200
committerLars Magne Ingebrigtsen2014-08-05 20:15:03 +0200
commit488df60acc38854e089a0f115feba5787be14ae8 (patch)
tree185412c2692da76b6cf3ef078e612fc1bd6be0bc
parent805318e13086c01dd65dae86145441711a434581 (diff)
downloademacs-488df60acc38854e089a0f115feba5787be14ae8.tar.gz
emacs-488df60acc38854e089a0f115feba5787be14ae8.zip
* lisp/net/shr.el (shr-copy-url): Also copy the image URL.
* lisp/net/shr.el (shr-copy-url): Also copy the image URL.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/net/shr.el10
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index aec717a159a..5ec506b63b0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12014-08-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * net/shr.el (shr-copy-url): Also copy the image URL.
4
12014-08-05 Michael Albinus <michael.albinus@gmx.de> 52014-08-05 Michael Albinus <michael.albinus@gmx.de>
2 6
3 * net/tramp-cache.el (tramp-flush-file-function): Suppress function 7 * net/tramp-cache.el (tramp-flush-file-function): Suppress function
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 58442575ad2..5e2e1eadf86 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -214,12 +214,16 @@ DOM should be a parse tree as generated by
214 (overlay-put overlay 'before-string nil)))) 214 (overlay-put overlay 'before-string nil))))
215 (forward-line 1))))) 215 (forward-line 1)))))
216 216
217(defun shr-copy-url () 217(defun shr-copy-url (&optional image-url)
218 "Copy the URL under point to the kill ring. 218 "Copy the URL under point to the kill ring.
219If IMAGE-URL (the prefix) is non-nil, or there is no link under
220point, but there is an image under point then copy the URL of the
221image under point instead.
219If called twice, then try to fetch the URL and see whether it 222If called twice, then try to fetch the URL and see whether it
220redirects somewhere else." 223redirects somewhere else."
221 (interactive) 224 (interactive "P")
222 (let ((url (get-text-property (point) 'shr-url))) 225 (let ((url (or (get-text-property (point) 'shr-url)
226 (get-text-property (point) 'image-url))))
223 (cond 227 (cond
224 ((not url) 228 ((not url)
225 (message "No URL under point")) 229 (message "No URL under point"))