X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgnus-async.el;h=870192fe1c099d57a25720cfd9d4a1e46d464d8f;hb=43790ecf5e0bbd7155862c7e6590d7c3c74873b4;hp=b8d4d130017868a33dcffa166f8256cc8332dc5a;hpb=4c2e20a67169654caf07221554d9e637d3f7bbfa;p=elisp%2Fgnus.git- diff --git a/lisp/gnus-async.el b/lisp/gnus-async.el index b8d4d13..870192f 100644 --- a/lisp/gnus-async.el +++ b/lisp/gnus-async.el @@ -1,7 +1,7 @@ ;;; gnus-async.el --- asynchronous support for Gnus -;; Copyright (C) 1996,97 Free Software Foundation, Inc. +;; Copyright (C) 1996,97,98 Free Software Foundation, Inc. -;; Author: Lars Magne Ingebrigtsen +;; Author: Lars Magne Ingebrigtsen ;; Keywords: news ;; This file is part of GNU Emacs. @@ -77,6 +77,7 @@ It should return non-nil if the article is to be prefetched." (defvar gnus-async-article-alist nil) (defvar gnus-async-article-semaphore '(nil)) (defvar gnus-async-fetch-list nil) +(defvar gnus-asynch-obarray nil) (defvar gnus-async-prefetch-headers-buffer " *Async Prefetch Headers*") (defvar gnus-async-header-prefetched nil) @@ -120,7 +121,10 @@ It should return non-nil if the article is to be prefetched." gnus-async-header-prefetched nil)) (defun gnus-async-set-buffer () - (nnheader-set-temp-buffer gnus-async-prefetch-article-buffer t)) + (nnheader-set-temp-buffer gnus-async-prefetch-article-buffer t) + (unless gnus-asynch-obarray + (set (make-local-variable 'gnus-asynch-obarray) + (gnus-make-hashtable 1023)))) (defun gnus-async-halt-prefetch () "Stop prefetching." @@ -209,10 +213,13 @@ It should return non-nil if the article is to be prefetched." (when arg (gnus-async-set-buffer) (gnus-async-with-semaphore - (push (list ',(intern (format "%s-%d" group article)) - ,mark (set-marker (make-marker) (point-max)) - ,group ,article) - gnus-async-article-alist))) + (setq + gnus-async-article-alist + (cons (list ',(intern (format "%s-%d" group article) + gnus-asynch-obarray) + ,mark (set-marker (make-marker) (point-max)) + ,group ,article) + gnus-async-article-alist)))) (if (not (gnus-buffer-live-p ,summary)) (gnus-async-with-semaphore (setq gnus-async-fetch-list nil)) @@ -259,8 +266,11 @@ It should return non-nil if the article is to be prefetched." (defun gnus-async-prefetched-article-entry (group article) "Return the entry for ARTICLE in GROUP iff it has been prefetched." - (let ((entry (assq (intern (format "%s-%d" group article)) - gnus-async-article-alist))) + (let ((entry (save-excursion + (gnus-async-set-buffer) + (assq (intern (format "%s-%d" group article) + gnus-asynch-obarray) + gnus-async-article-alist)))) ;; Perhaps something has emptied the buffer? (if (and entry (= (cadr entry) (caddr entry)))