[gnus git] branch master updated: n0-17-9-g109e5b5 =1= Use `url-queue-retrieve', if it exists.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  109e5b50fbd27112cbc7214ac23698e0182b8aa5 (commit)
      from  c54fbb1765b68ae57af94d52f83a38f6404bedb2 (commit)


- Log -----------------------------------------------------------------
commit 109e5b50fbd27112cbc7214ac23698e0182b8aa5
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Mon May 2 19:02:28 2011 +0200

    Use `url-queue-retrieve', if it exists.
    
    This should result in smoother asynchronous image retrieval when
    looking at messages with a lot of images.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d6ae172..0fef445 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
 2011-05-02  Lars Magne Ingebrigtsen  <[email protected]>
 
+	* gnus-html.el (gnus-html-schedule-image-fetching): Use
+	url-queue-retrieve, if it exists.
+
+	* shr.el (shr-tag-img): Ditto.
+
 	* gnus.el: Autoload more gnus-agent functions.
 
 	* gnus-art.el (gnus-request-article-this-buffer): Store articles in the
diff --git a/lisp/gnus-html.el b/lisp/gnus-html.el
index 7c0d63f..f380d07 100644
--- a/lisp/gnus-html.el
+++ b/lisp/gnus-html.el
@@ -386,16 +386,14 @@ Use ALT-TEXT for the image string."
   "Retrieve IMAGE, and place it into BUFFER on arrival."
   (gnus-message 8 "gnus-html-schedule-image-fetching: buffer %s, image %s"
                 buffer image)
-  (let ((args (list (car image)
+  (if (fboundp 'url-queue-retrieve)
+      (url-queue-retrieve (car image)
 		    'gnus-html-image-fetched
-		    (list buffer image))))
-    (when (> (length (if (featurep 'xemacs)
-			 (cdr (split-string (function-arglist 'url-retrieve)))
-		       (help-function-arglist 'url-retrieve)))
-	     4)
-      (setq args (nconc args (list t))))
+			  (list buffer image) t)
     (ignore-errors
-      (push (apply #'url-retrieve args) gnus-buffers))))
+      (url-retrieve (car image)
+		    'gnus-html-image-fetched
+		    (list buffer image)))))
 
 (defun gnus-html-image-fetched (status buffer image)
   "Callback function called when image has been fetched."
diff --git a/lisp/shr.el b/lisp/shr.el
index 20865bd..b2e4f1d 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -871,10 +871,13 @@ ones, in case fg and bg are nil."
 	  (shr-put-image (shr-get-image-data url) alt))
 	 (t
 	  (insert alt)
-	  (ignore-errors
-	    (url-retrieve (shr-encode-url url) 'shr-image-fetched
+	  (funcall
+	   (if (fboundp 'url-queue-retrieve)
+	       'url-queue-retrieve
+	     'url-retrieve)
+	   (shr-encode-url url) 'shr-image-fetched
 			  (list (current-buffer) start (point-marker))
-			  t))))
+	   t)))
 	(put-text-property start (point) 'keymap shr-map)
 	(put-text-property start (point) 'shr-alt alt)
 	(put-text-property start (point) 'image-url url)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog    |    5 +++++
 lisp/gnus-html.el |   16 +++++++---------
 lisp/shr.el       |   11 +++++++----
 3 files changed, 19 insertions(+), 13 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.