comparison lisp/gnus/gnus-async.el @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 9968f55ad26e
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 ;;; gnus-async.el --- asynchronous support for Gnus 1 ;;; gnus-async.el --- asynchronous support for Gnus
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004,
4 ;; 2005 Free Software Foundation, Inc.
3 5
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
5 ;; Keywords: news 7 ;; Keywords: news
6 8
7 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details. 19 ;; GNU General Public License for more details.
18 20
19 ;; You should have received a copy of the GNU General Public License 21 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02111-1307, USA. 24 ;; Boston, MA 02110-1301, USA.
23 25
24 ;;; Commentary: 26 ;;; Commentary:
25 27
26 ;;; Code: 28 ;;; Code:
27 29
29 31
30 (require 'gnus) 32 (require 'gnus)
31 (require 'gnus-sum) 33 (require 'gnus-sum)
32 (require 'nntp) 34 (require 'nntp)
33 35
36 (eval-when-compile
37 (when (featurep 'xemacs)
38 (require 'timer-funcs)))
39
34 (defgroup gnus-asynchronous nil 40 (defgroup gnus-asynchronous nil
35 "Support for asynchronous operations." 41 "Support for asynchronous operations."
36 :group 'gnus) 42 :group 'gnus)
37
38 (defcustom gnus-asynchronous nil
39 "*If nil, inhibit all Gnus asynchronicity.
40 If non-nil, let the other asynch variables be heeded."
41 :group 'gnus-asynchronous
42 :type 'boolean)
43 43
44 (defcustom gnus-use-article-prefetch 30 44 (defcustom gnus-use-article-prefetch 30
45 "*If non-nil, prefetch articles in groups that allow this. 45 "*If non-nil, prefetch articles in groups that allow this.
46 If a number, prefetch only that many articles forward; 46 If a number, prefetch only that many articles forward;
47 if t, prefetch as many articles as possible." 47 if t, prefetch as many articles as possible."
48 :group 'gnus-asynchronous 48 :group 'gnus-asynchronous
49 :type '(choice (const :tag "off" nil) 49 :type '(choice (const :tag "off" nil)
50 (const :tag "all" t) 50 (const :tag "all" t)
51 (integer :tag "some" 0))) 51 (integer :tag "some" 0)))
52
53 (defcustom gnus-asynchronous nil
54 "*If nil, inhibit all Gnus asynchronicity.
55 If non-nil, let the other asynch variables be heeded."
56 :group 'gnus-asynchronous
57 :type 'boolean)
52 58
53 (defcustom gnus-prefetched-article-deletion-strategy '(read exit) 59 (defcustom gnus-prefetched-article-deletion-strategy '(read exit)
54 "List of symbols that say when to remove articles from the prefetch buffer. 60 "List of symbols that say when to remove articles from the prefetch buffer.
55 Possible values in this list are `read', which means that 61 Possible values in this list are `read', which means that
56 articles are removed as they are read, and `exit', which means 62 articles are removed as they are read, and `exit', which means
274 ;; rather than checking time-spent-waiting, we 280 ;; rather than checking time-spent-waiting, we
275 ;; should check time-since-last-output, which 281 ;; should check time-since-last-output, which
276 ;; needs to be done in nntp.el. 282 ;; needs to be done in nntp.el.
277 (while (eq article gnus-async-current-prefetch-article) 283 (while (eq article gnus-async-current-prefetch-article)
278 (incf tries) 284 (incf tries)
279 (when (nntp-accept-process-output proc 1) 285 (when (nntp-accept-process-output proc)
280 (setq tries 0)) 286 (setq tries 0))
281 (when (and (not nntp-have-messaged) (eq 3 tries)) 287 (when (and (not nntp-have-messaged)
288 (= tries 3))
282 (gnus-message 5 "Waiting for async article...") 289 (gnus-message 5 "Waiting for async article...")
283 (setq nntp-have-messaged t))) 290 (setq nntp-have-messaged t)))
284 (quit 291 (quit
285 ;; if the user interrupted on a slow/hung connection, 292 ;; if the user interrupted on a slow/hung connection,
286 ;; do something friendly. 293 ;; do something friendly.
287 (when (< 3 tries) 294 (when (> tries 3)
288 (setq gnus-async-current-prefetch-article nil)) 295 (setq gnus-async-current-prefetch-article nil))
289 (signal 'quit nil))) 296 (signal 'quit nil)))
290 (when nntp-have-messaged 297 (when nntp-have-messaged
291 (gnus-message 5 ""))))) 298 (gnus-message 5 "")))))
292 299
370 (setq gnus-async-header-prefetched nil) 377 (setq gnus-async-header-prefetched nil)
371 t))) 378 t)))
372 379
373 (provide 'gnus-async) 380 (provide 'gnus-async)
374 381
382 ;;; arch-tag: fee61de5-3ea2-4de6-8578-2f90ce89391d
375 ;;; gnus-async.el ends here 383 ;;; gnus-async.el ends here