diff options
| -rw-r--r-- | lisp/gnus/gnus-async.el | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el index 1ce01856baf..e6fe2db3555 100644 --- a/lisp/gnus/gnus-async.el +++ b/lisp/gnus/gnus-async.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; gnus-async.el --- asynchronous support for Gnus | 1 | ;;; gnus-async.el --- asynchronous support for Gnus -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996-2019 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1996-2019 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -38,7 +38,6 @@ | |||
| 38 | "If non-nil, prefetch articles in groups that allow this. | 38 | "If non-nil, prefetch articles in groups that allow this. |
| 39 | If a number, prefetch only that many articles forward; | 39 | If a number, prefetch only that many articles forward; |
| 40 | if t, prefetch as many articles as possible." | 40 | if t, prefetch as many articles as possible." |
| 41 | :group 'gnus-asynchronous | ||
| 42 | :type '(choice (const :tag "off" nil) | 41 | :type '(choice (const :tag "off" nil) |
| 43 | (const :tag "all" t) | 42 | (const :tag "all" t) |
| 44 | (integer :tag "some" 0))) | 43 | (integer :tag "some" 0))) |
| @@ -46,7 +45,6 @@ if t, prefetch as many articles as possible." | |||
| 46 | (defcustom gnus-asynchronous nil | 45 | (defcustom gnus-asynchronous nil |
| 47 | "If nil, inhibit all Gnus asynchronicity. | 46 | "If nil, inhibit all Gnus asynchronicity. |
| 48 | If non-nil, let the other asynch variables be heeded." | 47 | If non-nil, let the other asynch variables be heeded." |
| 49 | :group 'gnus-asynchronous | ||
| 50 | :type 'boolean) | 48 | :type 'boolean) |
| 51 | 49 | ||
| 52 | (defcustom gnus-prefetched-article-deletion-strategy '(read exit) | 50 | (defcustom gnus-prefetched-article-deletion-strategy '(read exit) |
| @@ -55,28 +53,24 @@ Possible values in this list are `read', which means that | |||
| 55 | articles are removed as they are read, and `exit', which means | 53 | articles are removed as they are read, and `exit', which means |
| 56 | that all articles belonging to a group are removed on exit | 54 | that all articles belonging to a group are removed on exit |
| 57 | from that group." | 55 | from that group." |
| 58 | :group 'gnus-asynchronous | ||
| 59 | :type '(set (const read) (const exit))) | 56 | :type '(set (const read) (const exit))) |
| 60 | 57 | ||
| 61 | (defcustom gnus-use-header-prefetch nil | 58 | (defcustom gnus-use-header-prefetch nil |
| 62 | "If non-nil, prefetch the headers to the next group." | 59 | "If non-nil, prefetch the headers to the next group." |
| 63 | :group 'gnus-asynchronous | ||
| 64 | :type 'boolean) | 60 | :type 'boolean) |
| 65 | 61 | ||
| 66 | (defcustom gnus-async-prefetch-article-p 'gnus-async-unread-p | 62 | (defcustom gnus-async-prefetch-article-p #'gnus-async-unread-p |
| 67 | "Function called to say whether an article should be prefetched or not. | 63 | "Function called to say whether an article should be prefetched or not. |
| 68 | The function is called with one parameter -- the article data. | 64 | The function is called with one parameter -- the article data. |
| 69 | It should return non-nil if the article is to be prefetched." | 65 | It should return non-nil if the article is to be prefetched." |
| 70 | :group 'gnus-asynchronous | ||
| 71 | :type 'function) | 66 | :type 'function) |
| 72 | 67 | ||
| 73 | (defcustom gnus-async-post-fetch-function nil | 68 | (defcustom gnus-async-post-fetch-function #'ignore |
| 74 | "Function called after an article has been prefetched. | 69 | "Function called after an article has been prefetched. |
| 75 | The function will be called narrowed to the region of the article | 70 | The function will be called narrowed to the region of the article |
| 76 | that was fetched." | 71 | that was fetched." |
| 77 | :version "24.1" | 72 | :version "27.1" |
| 78 | :group 'gnus-asynchronous | 73 | :type 'function) |
| 79 | :type '(choice (const nil) function)) | ||
| 80 | 74 | ||
| 81 | ;;; Internal variables. | 75 | ;;; Internal variables. |
| 82 | 76 | ||
| @@ -212,8 +206,8 @@ that was fetched." | |||
| 212 | 206 | ||
| 213 | (defun gnus-make-async-article-function (group article mark summary next) | 207 | (defun gnus-make-async-article-function (group article mark summary next) |
| 214 | "Return a callback function." | 208 | "Return a callback function." |
| 215 | `(lambda (arg) | 209 | (lambda (arg) |
| 216 | (gnus-async-article-callback arg ,group ,article ,mark ,summary ,next))) | 210 | (gnus-async-article-callback arg group article mark summary next))) |
| 217 | 211 | ||
| 218 | (defun gnus-async-article-callback (arg group article mark summary next) | 212 | (defun gnus-async-article-callback (arg group article mark summary next) |
| 219 | "Function called when an async article is done being fetched." | 213 | "Function called when an async article is done being fetched." |
| @@ -354,9 +348,9 @@ that was fetched." | |||
| 354 | (erase-buffer) | 348 | (erase-buffer) |
| 355 | (let ((nntp-server-buffer (current-buffer)) | 349 | (let ((nntp-server-buffer (current-buffer)) |
| 356 | (nnheader-callback-function | 350 | (nnheader-callback-function |
| 357 | `(lambda (arg) | 351 | (lambda (_arg) |
| 358 | (setq gnus-async-header-prefetched | 352 | (setq gnus-async-header-prefetched |
| 359 | ,(cons group unread))))) | 353 | (cons group unread))))) |
| 360 | (gnus-retrieve-headers unread group gnus-fetch-old-headers)))))) | 354 | (gnus-retrieve-headers unread group gnus-fetch-old-headers)))))) |
| 361 | 355 | ||
| 362 | (defun gnus-async-retrieve-fetched-headers (articles group) | 356 | (defun gnus-async-retrieve-fetched-headers (articles group) |