diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-05 18:39:28 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-05 23:24:09 -0800 |
commit | 084f440571694ec14ea5def4191861bdb5854ea0 (patch) | |
tree | 1334b3af74aaf2d52b92672cf31ca04f1b119e60 /lisp/gnus/message.el | |
parent | f4d7ca73e3ab975fd920a2b0f2d1a7fdb5276d99 (diff) | |
download | emacs-084f440571694ec14ea5def4191861bdb5854ea0.tar.gz |
Simplify message-make-expires
* lisp/gnus/message.el (message-make-expires):
Use time-add instead of doing it by hand. This also calculates the
expiration time more accurately than the old code did.
Diffstat (limited to 'lisp/gnus/message.el')
-rw-r--r-- | lisp/gnus/message.el | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 8e7983a33c3..c2d14296f94 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -5948,12 +5948,9 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'." (defun message-make-expires () "Return an Expires header based on `message-expires'." - (let ((current (current-time)) - (future (* 1.0 message-expires 60 60 24))) + (let ((future (* 60 60 24 message-expires))) ;; Add the future to current. - (setcar current (+ (car current) (round (/ future (expt 2 16))))) - (setcar (cdr current) (+ (nth 1 current) (% (round future) (expt 2 16)))) - (message-make-date current))) + (message-make-date (time-add nil future)))) (defun message-make-path () "Return uucp path." |