]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge changes made in Gnus trunk.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 2 May 2011 22:41:38 +0000 (22:41 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 2 May 2011 22:41:38 +0000 (22:41 +0000)
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 agent if we haven't already (bug#8502).
gnus-async.el (gnus-async-article-callback): Put prefetched articles into the Agent, too.
gnus-agent.el (gnus-agent-store-article): New function.

lisp/gnus/ChangeLog
lisp/gnus/gnus-agent.el
lisp/gnus/gnus-art.el
lisp/gnus/gnus-async.el
lisp/gnus/gnus-html.el
lisp/gnus/gnus.el
lisp/gnus/shr.el

index e4a5aede155d29d83c69c512e2a2c20d940f8b90..784f374bafa8fb63227445daeafe6f78160d0b83 100644 (file)
@@ -1,5 +1,20 @@
 2011-05-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * 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
+       agent if we haven't already (bug#8502).
+
+       * gnus-async.el (gnus-async-article-callback): Put prefetched articles
+       into the Agent, too.
+
+       * gnus-agent.el (gnus-agent-store-article): New function.
+
        * nnheader.el (nnheader-insert-buffer-substring): Renamed from nntp-
        and moved from that file for reuse.
 
index 52fbe9da11fc66463c996f59a71654ee5b00967c..b4f0dc38e7ecdc68e7d678ab03832da1819c35d1 100644 (file)
@@ -3876,6 +3876,15 @@ has been fetched."
           (insert-file-contents file))
         t))))
 
+(defun gnus-agent-store-article (article group)
+  (let* ((gnus-command-method (gnus-find-method-for-group group))
+        (file (gnus-agent-article-name (number-to-string article) group))
+        (file-name-coding-system nnmail-pathname-coding-system)
+        (coding-system-for-write gnus-cache-coding-system))
+    (when (not (file-exists-p file))
+      (gnus-make-directory (file-name-directory file))
+      (write-region (point-min) (point-max) file nil 'silent))))
+
 (defun gnus-agent-regenerate-group (group &optional reread)
   "Regenerate GROUP.
 If REREAD is t, all articles in the .overview are marked as unread.
index e03c787d99502deef97399f8bfab470c9f86dfa8..690e29cb65a851834eb26e2cc95356f9d0e9c04b 100644 (file)
@@ -6841,7 +6841,10 @@ If given a prefix, show the hidden text instead."
                                              gnus-summary-buffer)
                    (when gnus-keep-backlog
                      (gnus-backlog-enter-article
-                      group article (current-buffer))))
+                      group article (current-buffer)))
+                   (when (and gnus-agent
+                              (gnus-agent-group-covered-p group))
+                     (gnus-agent-store-article article group)))
                  (setq result 'article))
                 (methods
                  (setq gnus-override-method (pop methods)))
index b7e24b8dcfdf788250234986dd0143ce2a17f467..ad85bc5cf76f74f2f457a969c0ee006ce1718b90 100644 (file)
@@ -237,6 +237,12 @@ that was fetched."
       (save-excursion
        (save-restriction
          (narrow-to-region mark (point-max))
+         ;; Put the articles into the agent, if they aren't already.
+         (when (and gnus-agent
+                    (gnus-agent-group-covered-p group))
+           (save-restriction
+             (narrow-to-region mark (point-max))
+             (gnus-agent-store-article article group)))
          ;; Prefetch images for the groups that want that.
          (when (fboundp 'gnus-html-prefetch-images)
            (gnus-html-prefetch-images summary))
index 7c0d63fb2464032e5c19f155679f191652a72f8f..f380d079d7bc2157e84b7b454bc0f78735443f3e 100644 (file)
@@ -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)
-                   '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))))
+  (if (fboundp 'url-queue-retrieve)
+      (url-queue-retrieve (car image)
+                         'gnus-html-image-fetched
+                         (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."
index 5ff03572832dec256551e9cd58408a1c9cd1c051..8797780251a31785a5dedab49a81097fc3a96ba9 100644 (file)
@@ -2910,7 +2910,8 @@ gnus-registry.el will populate this if it's loaded.")
       gnus-agent-save-active gnus-agent-method-p
       gnus-agent-get-undownloaded-list gnus-agent-fetch-session
       gnus-summary-set-agent-mark gnus-agent-save-group-info
-      gnus-agent-request-article gnus-agent-retrieve-headers)
+      gnus-agent-request-article gnus-agent-retrieve-headers
+      gnus-agent-store-article gnus-agent-group-covered-p)
      ("gnus-agent" :interactive t
       gnus-unplugged gnus-agentize gnus-agent-batch)
      ("gnus-vm" :interactive t gnus-summary-save-in-vm
index 20865bda5ac76e81e85accbce545d8000d0e4498..b2e4f1dc61d54c3e24f9143d93baea2c1e318203 100644 (file)
@@ -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
-                         (list (current-buffer) start (point-marker))
-                         t))))
+         (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)))
        (put-text-property start (point) 'keymap shr-map)
        (put-text-property start (point) 'shr-alt alt)
        (put-text-property start (point) 'image-url url)