Mercurial > hg > xemacs-beta
comparison lisp/gnus/gnus-async.el @ 42:8b8b7f3559a2 r19-15b104
Import from CVS: tag r19-15b104
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:54:51 +0200 |
parents | e04119814345 |
children | 8d2a9b52c682 |
comparison
equal
deleted
inserted
replaced
41:5d6df4963a99 | 42:8b8b7f3559a2 |
---|---|
124 "Stop prefetching." | 124 "Stop prefetching." |
125 (setq gnus-async-fetch-list nil)) | 125 (setq gnus-async-fetch-list nil)) |
126 | 126 |
127 (defun gnus-async-prefetch-next (group article summary) | 127 (defun gnus-async-prefetch-next (group article summary) |
128 "Possibly prefetch several articles starting with the article after ARTICLE." | 128 "Possibly prefetch several articles starting with the article after ARTICLE." |
129 (when (and (gnus-buffer-live-p summary) | 129 (when (and (buffer-live-p summary) |
130 gnus-asynchronous | 130 gnus-asynchronous |
131 (gnus-group-asynchronous-p group)) | 131 (gnus-group-asynchronous-p group)) |
132 (save-excursion | 132 (save-excursion |
133 (set-buffer gnus-summary-buffer) | 133 (set-buffer gnus-summary-buffer) |
134 (let ((next (caadr (gnus-data-find-list article)))) | 134 (let ((next (caadr (gnus-data-find-list article)))) |
141 (run-with-idle-timer | 141 (run-with-idle-timer |
142 0.1 nil 'gnus-async-prefetch-article group next summary))))))) | 142 0.1 nil 'gnus-async-prefetch-article group next summary))))))) |
143 | 143 |
144 (defun gnus-async-prefetch-article (group article summary &optional next) | 144 (defun gnus-async-prefetch-article (group article summary &optional next) |
145 "Possibly prefetch several articles starting with ARTICLE." | 145 "Possibly prefetch several articles starting with ARTICLE." |
146 (if (not (gnus-buffer-live-p summary)) | 146 (if (not (buffer-live-p summary)) |
147 (gnus-async-with-semaphore | 147 (gnus-async-with-semaphore |
148 (setq gnus-async-fetch-list nil)) | 148 (setq gnus-async-fetch-list nil)) |
149 (when (and gnus-asynchronous | 149 (when (and gnus-asynchronous |
150 (gnus-alive-p)) | 150 (gnus-alive-p)) |
151 (when next | 151 (when next |
152 (gnus-async-with-semaphore | 152 (gnus-async-with-semaphore |
153 (pop gnus-async-fetch-list))) | 153 (pop gnus-async-fetch-list))) |
154 (let ((do-fetch next) | 154 (let ((do-fetch next) |
155 (do-message t)) ;(eq major-mode 'gnus-summary-mode))) | 155 (do-message t)) ;(eq major-mode 'gnus-summary-mode))) |
156 (when (and (gnus-group-asynchronous-p group) | 156 (when (and (gnus-group-asynchronous-p group) |
157 (gnus-buffer-live-p summary) | 157 (buffer-live-p summary) |
158 (or (not next) | 158 (or (not next) |
159 gnus-async-fetch-list)) | 159 gnus-async-fetch-list)) |
160 (gnus-async-with-semaphore | 160 (gnus-async-with-semaphore |
161 (unless next | 161 (unless next |
162 (setq do-fetch (not gnus-async-fetch-list)) | 162 (setq do-fetch (not gnus-async-fetch-list)) |
209 (gnus-async-with-semaphore | 209 (gnus-async-with-semaphore |
210 (push (list ',(intern (format "%s-%d" group article)) | 210 (push (list ',(intern (format "%s-%d" group article)) |
211 ,mark (set-marker (make-marker) (point-max)) | 211 ,mark (set-marker (make-marker) (point-max)) |
212 ,group ,article) | 212 ,group ,article) |
213 gnus-async-article-alist))) | 213 gnus-async-article-alist))) |
214 (if (not (gnus-buffer-live-p ,summary)) | 214 (if (not (buffer-live-p ,summary)) |
215 (gnus-async-with-semaphore | 215 (gnus-async-with-semaphore |
216 (setq gnus-async-fetch-list nil)) | 216 (setq gnus-async-fetch-list nil)) |
217 (gnus-async-prefetch-article ,group ,next ,summary t))))) | 217 (gnus-async-prefetch-article ,group ,next ,summary t))))) |
218 | 218 |
219 (defun gnus-async-unread-p (data) | 219 (defun gnus-async-unread-p (data) |