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.
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.
(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.
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)))
(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))
"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."
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
(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)