:group 'gnus-asynchronous
:type 'function)
+(defcustom gnus-async-post-fetch-function nil
+ "Function called after an article has been prefetched.
+The function will be called narrowed to the region of the article
+that was fetched."
+ :group 'gnus-asynchronous
+ :type 'function)
+
;;; Internal variables.
(defvar gnus-async-prefetch-article-buffer " *Async Prefetch Article*")
(setq gnus-async-current-prefetch-article nil)
(when arg
(gnus-async-set-buffer)
+ (when gnus-async-post-fetch-function
+ (save-excursion
+ (save-restriction
+ (narrow-to-region mark (point-max))
+ (funcall gnus-async-post-fetch-function))))
(gnus-async-with-semaphore
(setq
gnus-async-article-alist
(decf total-size (cadr file))
(delete-file (nth 2 file)))))))
+(defun gnus-html-prefetch-images ()
+ (save-match-data
+ (let (urls)
+ (while (re-search-forward "<img.*src=\"\\([^\"]+\\)" nil t)
+ (let ((url (match-string 1)))
+ (when (or (null mm-w3m-safe-url-regexp)
+ (string-match mm-w3m-safe-url-regexp url))
+ (unless (file-exists-p (gnus-html-image-id url))
+ (push url urls)
+ (push (gnus-html-image-id url) urls)
+ (push "-o" urls)))))
+ (apply 'start-process
+ "images" nil "curl"
+ "-s" "--create-dirs"
+ urls))))
+
;;; gnus-html.el ends here