summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-delay.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/gnus-delay.el')
-rw-r--r--lisp/gnus/gnus-delay.el22
1 files changed, 8 insertions, 14 deletions
diff --git a/lisp/gnus/gnus-delay.el b/lisp/gnus/gnus-delay.el
index e013f26adf2..aabf23924a0 100644
--- a/lisp/gnus/gnus-delay.el
+++ b/lisp/gnus/gnus-delay.el
@@ -98,19 +98,15 @@ DELAY is a string, giving the length of the time. Possible values are:
(setq hour (string-to-number (match-string 1 delay))
minute (string-to-number (match-string 2 delay)))
;; Use current time, except...
- (setq deadline (apply 'vector (decode-time)))
+ (setq deadline (decode-time))
;; ... for minute and hour.
- (aset deadline 1 minute)
- (aset deadline 2 hour)
- ;; Convert to seconds.
- (setq deadline (float-time (apply 'encode-time
- (append deadline nil))))
+ (setq deadline (apply #'encode-time (car deadline) minute hour
+ (nthcdr 3 deadline)))
;; If this time has passed already, add a day.
- (when (< deadline (float-time))
- (setq deadline (+ 86400 deadline))) ; 86400 secs/day
+ (when (time-less-p deadline nil)
+ (setq deadline (time-add 86400 deadline))) ; 86400 secs/day
;; Convert seconds to date header.
- (setq deadline (message-make-date
- (encode-time deadline))))
+ (setq deadline (message-make-date deadline)))
((string-match "\\([0-9]+\\)\\s-*\\([mhdwMY]\\)" delay)
(setq num (match-string 1 delay))
(setq unit (match-string 2 delay))
@@ -128,8 +124,7 @@ DELAY is a string, giving the length of the time. Possible values are:
(setq delay (* num 60 60)))
(t
(setq delay (* num 60))))
- (setq deadline (message-make-date
- (encode-time (+ (float-time) delay)))))
+ (setq deadline (message-make-date (time-add nil delay))))
(t (error "Malformed delay `%s'" delay)))
(message-add-header (format "%s: %s" gnus-delay-header deadline)))
(set-buffer-modified-p t)
@@ -164,8 +159,7 @@ DELAY is a string, giving the length of the time. Possible values are:
nil t)
(progn
(setq deadline (nnheader-header-value))
- (setq deadline (apply 'encode-time
- (parse-time-string deadline)))
+ (setq deadline (encode-time (parse-time-string deadline)))
(unless (time-less-p nil deadline)
(message "Sending delayed article %d" article)
(gnus-draft-send article group)