aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2019-06-03 13:44:23 -0400
committerStefan Monnier2019-06-03 13:44:23 -0400
commit4b87a032dcaebad3ba37cdb3cb0cdd2760fc24fd (patch)
treea0b8aceda0ac4544720d4062d86cace35aa90dc8
parent83c3a61e4ca091580cafbabe34b54e4a9261ad16 (diff)
downloademacs-4b87a032dcaebad3ba37cdb3cb0cdd2760fc24fd.tar.gz
emacs-4b87a032dcaebad3ba37cdb3cb0cdd2760fc24fd.zip
* lisp/gnus/gnus-async.el: Use lexical-binding
Remove redundant :group args. (gnus-async-post-fetch-function): Make it always be a function. (gnus-make-async-article-function, gnus-async-prefetch-headers): Use a closure rather than `(lambda ...)
-rw-r--r--lisp/gnus/gnus-async.el24
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.
39If a number, prefetch only that many articles forward; 39If a number, prefetch only that many articles forward;
40if t, prefetch as many articles as possible." 40if 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.
48If non-nil, let the other asynch variables be heeded." 47If 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
55articles are removed as they are read, and `exit', which means 53articles are removed as they are read, and `exit', which means
56that all articles belonging to a group are removed on exit 54that all articles belonging to a group are removed on exit
57from that group." 55from 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.
68The function is called with one parameter -- the article data. 64The function is called with one parameter -- the article data.
69It should return non-nil if the article is to be prefetched." 65It 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.
75The function will be called narrowed to the region of the article 70The function will be called narrowed to the region of the article
76that was fetched." 71that 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)