]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/gnus-async.el
Avoid the obsoleted defmethod
[gnu-emacs] / lisp / gnus / gnus-async.el
index c5d64332547e0ba52c4d083a8209f8bb1e1cc864..ba72d820431d3c25f1c931a790291578459b2887 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-async.el --- asynchronous support for Gnus
 
-;; Copyright (C) 1996-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2016 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -76,7 +76,7 @@ The function will be called narrowed to the region of the article
 that was fetched."
   :version "24.1"
   :group 'gnus-asynchronous
-  :type 'function)
+  :type '(choice (const nil) function))
 
 ;;; Internal variables.
 
@@ -148,18 +148,13 @@ that was fetched."
     (with-current-buffer gnus-summary-buffer
       (let ((next (caadr (gnus-data-find-list article))))
        (when next
-         (if (not (fboundp 'run-with-idle-timer))
-             ;; This is either an older Emacs or XEmacs, so we
-             ;; do this, which leads to slightly slower article
-             ;; buffer display.
-             (gnus-async-prefetch-article group next summary)
-           (when gnus-async-timer
-             (ignore-errors
-               (nnheader-cancel-timer 'gnus-async-timer)))
-           (setq gnus-async-timer
-                 (run-with-idle-timer
-                  0.1 nil 'gnus-async-prefetch-article
-                  group next summary))))))))
+         (when gnus-async-timer
+           (ignore-errors
+             (nnheader-cancel-timer 'gnus-async-timer)))
+         (setq gnus-async-timer
+               (run-with-idle-timer
+                0.1 nil 'gnus-async-prefetch-article
+                group next summary)))))))
 
 (defun gnus-async-prefetch-article (group article summary &optional next)
   "Possibly prefetch several articles starting with ARTICLE."
@@ -226,9 +221,6 @@ that was fetched."
   `(lambda (arg)
      (gnus-async-article-callback arg ,group ,article ,mark ,summary ,next)))
 
-(eval-when-compile
-  (autoload 'gnus-html-prefetch-images "gnus-html"))
-
 (defun gnus-async-article-callback (arg group article mark summary next)
   "Function called when an async article is done being fetched."
   (save-excursion