summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-demon.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-07-30 13:05:17 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-07-30 13:05:17 +0200
commitbd26eff54779bfd5739c1d663bcabd19246682d8 (patch)
treeb362161824f4959630f7fc10690f81d23401aed1 /lisp/gnus/gnus-demon.el
parent608832acc35420fc7140f73cd8e18f1a00f93ec6 (diff)
downloademacs-bd26eff54779bfd5739c1d663bcabd19246682d8.tar.gz
emacs-bd26eff54779bfd5739c1d663bcabd19246682d8.tar.bz2
emacs-bd26eff54779bfd5739c1d663bcabd19246682d8.zip
Use decoded time accessors in Gnus
* lisp/gnus/nnimap.el (nnimap-find-expired-articles): * lisp/gnus/nndiary.el (nndiary-compute-reminders) (nndiary-last-occurrence, nndiary-next-occurrence): * lisp/gnus/message.el (message-make-expires-date): * lisp/gnus/gnus-util.el (gnus-seconds-today) (gnus-seconds-month, gnus-seconds-year): * lisp/gnus/gnus-demon.el (gnus-demon-time-to-step): * lisp/gnus/gnus-art.el (article-make-date-line): Use decoded time accessors.
Diffstat (limited to 'lisp/gnus/gnus-demon.el')
-rw-r--r--lisp/gnus/gnus-demon.el35
1 files changed, 19 insertions, 16 deletions
diff --git a/lisp/gnus/gnus-demon.el b/lisp/gnus/gnus-demon.el
index cb70d9525c2..b26aaa15297 100644
--- a/lisp/gnus/gnus-demon.el
+++ b/lisp/gnus/gnus-demon.el
@@ -176,22 +176,25 @@ marked with SPECIAL."
(thenHour (elt thenParts 2))
(thenMin (elt thenParts 1))
;; convert time as elements into number of seconds since EPOCH.
- (then (encode-time 0
- thenMin
- thenHour
- ;; If THEN is earlier than NOW, make it
- ;; same time tomorrow. Doc for encode-time
- ;; says that this is OK.
- (+ (elt nowParts 3)
- (if (or (< thenHour (elt nowParts 2))
- (and (= thenHour (elt nowParts 2))
- (<= thenMin (elt nowParts 1))))
- 1 0))
- (elt nowParts 4)
- (elt nowParts 5)
- (elt nowParts 6)
- (elt nowParts 7)
- (elt nowParts 8)))
+ (then (encode-time
+ 0
+ thenMin
+ thenHour
+ ;; If THEN is earlier than NOW, make it
+ ;; same time tomorrow. Doc for encode-time
+ ;; says that this is OK.
+ (+ (decoded-time-day nowParts)
+ (if (or (< thenHour (decoded-time-hour nowParts))
+ (and (= thenHour
+ (decoded-time-hour nowParts))
+ (<= thenMin
+ (decoded-time-minute nowParts))))
+ 1 0))
+ (decoded-time-month nowParts)
+ (decoded-time-year nowParts)
+ (decoded-time-weekday nowParts)
+ (decoded-time-dst nowParts)
+ (decoded-time-zone nowParts)))
(diff (float-time (time-subtract then now))))
;; Return number of timesteps in the number of seconds.
(round diff gnus-demon-timestep)))