summaryrefslogtreecommitdiff
path: root/lisp/gnus/nndiary.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/nndiary.el')
-rw-r--r--lisp/gnus/nndiary.el61
1 files changed, 28 insertions, 33 deletions
diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el
index b3e83e494d7..15003fabcd2 100644
--- a/lisp/gnus/nndiary.el
+++ b/lisp/gnus/nndiary.el
@@ -1,4 +1,4 @@
-;;; nndiary.el --- A diary back end for Gnus
+;;; nndiary.el --- A diary back end for Gnus -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
@@ -149,7 +149,6 @@ In order to make this clear, here are some examples:
- (360 . minute): for an appointment at 18:30 and 15 seconds, this would
pop up the appointment message at 12:30."
- :group 'nndiary
:type '(repeat (cons :format "%v\n"
(integer :format "%v")
(choice :format "%[%v(s)%] before...\n"
@@ -163,8 +162,7 @@ In order to make this clear, here are some examples:
(defcustom nndiary-week-starts-on-monday nil
"Whether a week starts on monday (otherwise, sunday)."
- :type 'boolean
- :group 'nndiary)
+ :type 'boolean)
(define-obsolete-variable-alias 'nndiary-request-create-group-hooks
@@ -172,7 +170,6 @@ In order to make this clear, here are some examples:
(defcustom nndiary-request-create-group-functions nil
"Hook run after `nndiary-request-create-group' is executed.
The hook functions will be called with the full group name as argument."
- :group 'nndiary
:type 'hook)
(define-obsolete-variable-alias 'nndiary-request-update-info-hooks
@@ -180,7 +177,6 @@ The hook functions will be called with the full group name as argument."
(defcustom nndiary-request-update-info-functions nil
"Hook run after `nndiary-request-update-info' is executed.
The hook functions will be called with the full group name as argument."
- :group 'nndiary
:type 'hook)
(define-obsolete-variable-alias 'nndiary-request-accept-article-hooks
@@ -189,12 +185,10 @@ The hook functions will be called with the full group name as argument."
"Hook run before accepting an article.
Executed near the beginning of `nndiary-request-accept-article'.
The hook functions will be called with the article in the current buffer."
- :group 'nndiary
:type 'hook)
(defcustom nndiary-check-directory-twice t
"If t, check directories twice to avoid NFS failures."
- :group 'nndiary
:type 'boolean)
@@ -475,7 +469,7 @@ all. This may very well take some time.")
(cons (if group-num (car group-num) group)
(string-to-number (file-name-nondirectory path)))))))
-(deffoo nndiary-request-group (group &optional server dont-check info)
+(deffoo nndiary-request-group (group &optional server dont-check _info)
(let ((file-name-coding-system nnmail-pathname-coding-system))
(cond
((not (nndiary-possibly-change-directory group server))
@@ -509,11 +503,11 @@ all. This may very well take some time.")
(nndiary-possibly-change-directory group server)
(nnmail-get-new-mail 'nndiary 'nndiary-save-nov nndiary-directory group)))
-(deffoo nndiary-close-group (group &optional server)
+(deffoo nndiary-close-group (_group &optional _server)
(setq nndiary-article-file-alist nil)
t)
-(deffoo nndiary-request-create-group (group &optional server args)
+(deffoo nndiary-request-create-group (group &optional server _args)
(nndiary-possibly-change-directory nil server)
(nnmail-activate 'nndiary)
(cond
@@ -532,8 +526,8 @@ all. This may very well take some time.")
(nndiary-possibly-change-directory group server)
(let ((articles (nnheader-directory-articles nndiary-current-directory)))
(when articles
- (setcar active (apply 'min articles))
- (setcdr active (apply 'max articles))))
+ (setcar active (apply #'min articles))
+ (setcdr active (apply #'max articles))))
(nnmail-save-active nndiary-group-alist nndiary-active-file)
(run-hook-with-args 'nndiary-request-create-group-functions
(gnus-group-prefixed-name group
@@ -541,7 +535,7 @@ all. This may very well take some time.")
t))
))
-(deffoo nndiary-request-list (&optional server)
+(deffoo nndiary-request-list (&optional _server)
(save-excursion
(let ((nnmail-file-coding-system nnmail-active-file-coding-system)
(file-name-coding-system nnmail-pathname-coding-system))
@@ -549,10 +543,10 @@ all. This may very well take some time.")
(setq nndiary-group-alist (nnmail-get-active))
t))
-(deffoo nndiary-request-newgroups (date &optional server)
+(deffoo nndiary-request-newgroups (_date &optional server)
(nndiary-request-list server))
-(deffoo nndiary-request-list-newsgroups (&optional server)
+(deffoo nndiary-request-list-newsgroups (&optional _server)
(save-excursion
(nnmail-find-file nndiary-newsgroups-file)))
@@ -589,14 +583,14 @@ all. This may very well take some time.")
(let ((active (nth 1 (assoc group nndiary-group-alist))))
(when active
(setcar active (or (and active-articles
- (apply 'min active-articles))
+ (apply #'min active-articles))
(1+ (cdr active)))))
(nnmail-save-active nndiary-group-alist nndiary-active-file))
(nndiary-save-nov)
(nconc rest articles)))
(deffoo nndiary-request-move-article
- (article group server accept-form &optional last move-is-internal)
+ (article group server accept-form &optional last _move-is-internal)
(let ((buf (gnus-get-buffer-create " *nndiary move*"))
result)
(nndiary-possibly-change-directory group server)
@@ -609,7 +603,7 @@ all. This may very well take some time.")
nndiary-article-file-alist)
(with-current-buffer buf
(insert-buffer-substring nntp-server-buffer)
- (setq result (eval accept-form))
+ (setq result (eval accept-form t))
(kill-buffer (current-buffer))
result))
(progn
@@ -772,7 +766,7 @@ all. This may very well take some time.")
;;; Interface optional functions ============================================
-(deffoo nndiary-request-update-info (group info &optional server)
+(deffoo nndiary-request-update-info (group info &optional _server)
(nndiary-possibly-change-directory group)
(let ((timestamp (gnus-group-parameter-value (gnus-info-params info)
'timestamp t)))
@@ -960,7 +954,7 @@ all. This may very well take some time.")
(setq nndiary-article-file-alist
(sort
(nnheader-article-to-file-alist nndiary-current-directory)
- 'car-less-than-car)))
+ #'car-less-than-car)))
(setq active
(if nndiary-article-file-alist
(cons (caar nndiary-article-file-alist)
@@ -1039,6 +1033,8 @@ all. This may very well take some time.")
;; Save the active file.
(nnmail-save-active nndiary-group-alist nndiary-active-file))
+(defvar nndiary-files) ; dynamically bound in nndiary-generate-nov-databases-1
+
(defun nndiary-generate-nov-databases-1 (dir &optional seen no-active)
"Regenerate the NOV database in DIR."
(interactive "DRegenerate NOV in: ")
@@ -1055,7 +1051,7 @@ all. This may very well take some time.")
(nndiary-generate-nov-databases-1 dir seen))))
;; Do this directory.
(let ((nndiary-files (sort (nnheader-article-to-file-alist dir)
- 'car-less-than-car)))
+ #'car-less-than-car)))
(if (not nndiary-files)
(let* ((group (nnheader-file-to-group
(directory-file-name dir) nndiary-directory))
@@ -1068,7 +1064,6 @@ all. This may very well take some time.")
(unless no-active
(nnmail-save-active nndiary-group-alist nndiary-active-file))))))
-(defvar nndiary-files) ; dynamically bound in nndiary-generate-nov-databases-1
(defun nndiary-generate-active-info (dir)
;; Update the active info for this group.
(let* ((group (nnheader-file-to-group
@@ -1245,7 +1240,7 @@ all. This may very well take some time.")
(defun nndiary-unflatten (spec)
;; opposite of flatten: build ranges if possible
- (setq spec (sort spec '<))
+ (setq spec (sort spec #'<))
(let (min max res)
(while (setq min (pop spec))
(setq max min)
@@ -1300,7 +1295,7 @@ all. This may very well take some time.")
(apply #'encode-time 0 0 0 1 1 (nthcdr 5 date-elts))
(* (car reminder) 400861056))))
res))
- (sort res 'time-less-p)))
+ (sort res #'time-less-p)))
(defun nndiary-last-occurrence (sched)
;; Returns the last occurrence of schedule SCHED as an Emacs time struct, or
@@ -1318,8 +1313,8 @@ all. This may very well take some time.")
;; bored in finding a good algorithm for doing that ;-)
;; ### FIXME: remove identical entries.
(let ((dom-list (nth 2 sched))
- (month-list (sort (nndiary-flatten (nth 3 sched) 1 12) '>))
- (year-list (sort (nndiary-flatten (nth 4 sched) 1971) '>))
+ (month-list (sort (nndiary-flatten (nth 3 sched) 1 12) #'>))
+ (year-list (sort (nndiary-flatten (nth 4 sched) 1971) #'>))
(dow-list (nth 5 sched)))
;; Special case: an asterisk in one of the days specifications means
;; that only the other should be taken into account. If both are
@@ -1370,7 +1365,7 @@ all. This may very well take some time.")
(setq day (+ 7 day))))
;; Finally, if we have some days, they are valid
(when days
- (sort days '>)
+ (sort days #'>)
(throw 'found
(encode-time 0 minute hour
(car days) month year time-zone)))
@@ -1396,12 +1391,12 @@ all. This may very well take some time.")
(this-day (decoded-time-day today))
(this-month (decoded-time-month today))
(this-year (decoded-time-year today))
- (minute-list (sort (nndiary-flatten (nth 0 sched) 0 59) '<))
- (hour-list (sort (nndiary-flatten (nth 1 sched) 0 23) '<))
+ (minute-list (sort (nndiary-flatten (nth 0 sched) 0 59) #'<))
+ (hour-list (sort (nndiary-flatten (nth 1 sched) 0 23) #'<))
(dom-list (nth 2 sched))
- (month-list (sort (nndiary-flatten (nth 3 sched) 1 12) '<))
+ (month-list (sort (nndiary-flatten (nth 3 sched) 1 12) #'<))
(years (if (nth 4 sched)
- (sort (nndiary-flatten (nth 4 sched) 1971) '<)
+ (sort (nndiary-flatten (nth 4 sched) 1971) #'<)
t))
(dow-list (nth 5 sched))
(year (1- this-year))
@@ -1474,7 +1469,7 @@ all. This may very well take some time.")
;; Aaaaaaall right. Now we have a valid list of DAYS for
;; this month and this year.
(when days
- (setq days (sort days '<))
+ (setq days (sort days #'<))
;; Remove past days for this year and this month.
(and (= year this-year)
(= month this-month)