summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-async.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/gnus-async.el')
-rw-r--r--lisp/gnus/gnus-async.el61
1 files changed, 28 insertions, 33 deletions
diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el
index a06724855c5..65189573da3 100644
--- a/lisp/gnus/gnus-async.el
+++ b/lisp/gnus/gnus-async.el
@@ -33,10 +33,6 @@
(require 'gnus-sum)
(require 'nntp)
-(eval-when-compile
- (when (featurep 'xemacs)
- (require 'timer-funcs)))
-
(defgroup gnus-asynchronous nil
"Support for asynchronous operations."
:group 'gnus)
@@ -274,28 +270,29 @@ It should return non-nil if the article is to be prefetched."
(nntp-server-buffer (current-buffer))
(nntp-have-messaged nil)
(tries 0))
- (condition-case nil
- ;; FIXME: we could stop waiting after some
- ;; timeout, but this is the wrong place to do it.
- ;; rather than checking time-spent-waiting, we
- ;; should check time-since-last-output, which
- ;; needs to be done in nntp.el.
- (while (eq article gnus-async-current-prefetch-article)
- (incf tries)
- (when (nntp-accept-process-output proc)
- (setq tries 0))
- (when (and (not nntp-have-messaged)
- (= tries 3))
- (gnus-message 5 "Waiting for async article...")
- (setq nntp-have-messaged t)))
- (quit
- ;; if the user interrupted on a slow/hung connection,
- ;; do something friendly.
- (when (> tries 3)
- (setq gnus-async-current-prefetch-article nil))
- (signal 'quit nil)))
- (when nntp-have-messaged
- (gnus-message 5 "")))))
+ (when proc
+ (condition-case nil
+ ;; FIXME: we could stop waiting after some
+ ;; timeout, but this is the wrong place to do it.
+ ;; rather than checking time-spent-waiting, we
+ ;; should check time-since-last-output, which
+ ;; needs to be done in nntp.el.
+ (while (eq article gnus-async-current-prefetch-article)
+ (incf tries)
+ (when (nntp-accept-process-output proc)
+ (setq tries 0))
+ (when (and (not nntp-have-messaged)
+ (= tries 3))
+ (gnus-message 5 "Waiting for async article...")
+ (setq nntp-have-messaged t)))
+ (quit
+ ;; if the user interrupted on a slow/hung connection,
+ ;; do something friendly.
+ (when (> tries 3)
+ (setq gnus-async-current-prefetch-article nil))
+ (signal 'quit nil)))
+ (when nntp-have-messaged
+ (gnus-message 5 ""))))))
(defun gnus-async-delete-prefetched-entry (entry)
"Delete ENTRY from buffer and alist."
@@ -311,13 +308,11 @@ It should return non-nil if the article is to be prefetched."
"Remove all articles belonging to GROUP from the prefetch buffer."
(when (and (gnus-group-asynchronous-p group)
(memq 'exit gnus-prefetched-article-deletion-strategy))
- (let ((alist gnus-async-article-alist))
- (save-excursion
- (gnus-async-set-buffer)
- (while alist
- (when (equal group (nth 3 (car alist)))
- (gnus-async-delete-prefetched-entry (car alist)))
- (pop alist))))))
+ (save-excursion
+ (gnus-async-set-buffer)
+ (dolist (entry gnus-async-article-alist)
+ (when (equal group (nth 3 entry))
+ (gnus-async-delete-prefetched-entry entry))))))
(defun gnus-async-prefetched-article-entry (group article)
"Return the entry for ARTICLE in GROUP if it has been prefetched."