diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-08-17 15:39:18 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-08-17 15:43:05 -0700 |
commit | c90a420779448fecf1941f063da3e8276dc3d0d7 (patch) | |
tree | 691868a02f1e99ee4e3e058b23836501d3f0ffad /lisp/calc/calc-forms.el | |
parent | 6616806896060d95355c965599517d7065c19b86 (diff) | |
download | emacs-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/calc/calc-forms.el')
-rw-r--r-- | lisp/calc/calc-forms.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index c410ffe449c..7e8a8dcc9d0 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -37,7 +37,7 @@ (defun calc-time () (interactive) (calc-wrapper - (let ((time (decode-time))) + (let ((time (decode-time nil nil 'integer))) ;; FIXME: Support subseconds. (calc-enter-result 0 "time" (list 'mod (list 'hms @@ -499,7 +499,8 @@ in the Gregorian calendar and the remaining part determines the time." (math-add (math-float date) (math-div (math-add (+ (* (nth 3 dt) 3600) (* (nth 4 dt) 60)) - (nth 5 dt)) + ;; FIXME: Support subseconds. + (time-convert (nth 5 dt) 'integer)) '(float 864 2))) date))) @@ -1327,7 +1328,8 @@ as measured in the integer number of days before December 31, 1 BC (Gregorian)." (math-parse-iso-date-validate isoyear isoweek isoweekday hour minute second))))) (defun calcFunc-now (&optional zone) - (let ((date (let ((now (decode-time))) + ;; FIXME: Support subseconds. + (let ((date (let ((now (decode-time nil nil 'integer))) (list 'date (math-dt-to-date (list (decoded-time-year now) (decoded-time-month now) |