summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-util.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-08-17 15:39:18 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-08-17 15:43:05 -0700
commitc90a420779448fecf1941f063da3e8276dc3d0d7 (patch)
tree691868a02f1e99ee4e3e058b23836501d3f0ffad /lisp/gnus/gnus-util.el
parent6616806896060d95355c965599517d7065c19b86 (diff)
downloademacs-c90a420779448fecf1941f063da3e8276dc3d0d7.tar.gz
Add FIXMEs for subsecond support
This adds FIXMEs to areas where Lisp code should support subsecond information in broken-down timestamps. It also fixes some unnecessary truncation of timestamps, and ports the code to a hypothetical future Emacs version where (decode-time) returns subsecond timestamps by default. * lisp/calc/calc-forms.el (calc-time, math-iso-dt-to-date) (calcFunc-now): * lisp/calendar/icalendar.el (icalendar--add-decoded-times): * lisp/calendar/iso8601.el (iso8601-parse-interval): Truncate seconds to an integer, and add a FIXME about subseconds support. * lisp/calendar/icalendar.el (icalendar--decode-isodatetime) (icalendar--decode-isoduration): Add a FIXME about subseconds support. * lisp/gnus/gnus-delay.el (gnus-delay-article): Don’t truncate seconds to an integer, as there’s no need to do that here. * lisp/gnus/gnus-util.el (gnus-seconds-today) (gnus-seconds-month, gnus-seconds-year): * lisp/gnus/message.el (message-make-expires-date): * lisp/org/org-timer.el (org-timer-show-remaining-time): * lisp/vc/ediff-mult.el (ediff-format-date): Truncate seconds to an integer, as that’s what’s wanted here. * lisp/midnight.el (midnight-next): Ceiling seconds to an integer, as that’s what wanted here.
Diffstat (limited to 'lisp/gnus/gnus-util.el')
-rw-r--r--lisp/gnus/gnus-util.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index c6be59fd19f..f73af8e261c 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -357,24 +357,24 @@ Symbols are also allowed; their print names are used instead."
;; the full date if it's older)
(defun gnus-seconds-today ()
- "Return the number of seconds passed today."
- (let ((now (decode-time)))
+ "Return the integer number of seconds passed today."
+ (let ((now (decode-time nil nil 'integer)))
(+ (decoded-time-second now)
(* (decoded-time-minute now) 60)
(* (decoded-time-hour now) 3600))))
(defun gnus-seconds-month ()
- "Return the number of seconds passed this month."
- (let ((now (decode-time)))
+ "Return the integer number of seconds passed this month."
+ (let ((now (decode-time nil nil 'integer)))
(+ (decoded-time-second now)
(* (decoded-time-minute now) 60)
(* (decoded-time-hour now) 3600)
(* (- (decoded-time-day now) 1) 3600 24))))
(defun gnus-seconds-year ()
- "Return the number of seconds passed this year."
+ "Return the integer number of seconds passed this year."
(let* ((current (current-time))
- (now (decode-time current))
+ (now (decode-time current nil 'integer))
(days (format-time-string "%j" current)))
(+ (decoded-time-second now)
(* (decoded-time-minute now) 60)