emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117649: * lisp/net/shr.el (shr-copy-url): Also copy


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r117649: * lisp/net/shr.el (shr-copy-url): Also copy the image URL.
Date: Tue, 05 Aug 2014 18:15:09 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117649
revision-id: address@hidden
parent: address@hidden
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Tue 2014-08-05 20:15:03 +0200
message:
  * lisp/net/shr.el (shr-copy-url): Also copy the image URL.
  
  * lisp/net/shr.el (shr-copy-url): Also copy the image URL.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/shr.el                shr.el-20101002102929-yfzewk55rsg0mn93-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-08-05 08:13:28 +0000
+++ b/lisp/ChangeLog    2014-08-05 18:15:03 +0000
@@ -1,3 +1,7 @@
+2014-08-05  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * net/shr.el (shr-copy-url): Also copy the image URL.
+
 2014-08-05  Michael Albinus  <address@hidden>
 
        * net/tramp-cache.el (tramp-flush-file-function): Suppress function

=== modified file 'lisp/net/shr.el'
--- a/lisp/net/shr.el   2014-04-14 22:01:54 +0000
+++ b/lisp/net/shr.el   2014-08-05 18:15:03 +0000
@@ -214,12 +214,16 @@
              (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"))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]