* lisp/calendar/time-date.el (seconds-to-time): Use the original arg list

This commit is contained in:
Stefan Monnier 2022-08-14 10:41:40 -04:00
parent d28f1677c3
commit 397fdc22eb
2 changed files with 16 additions and 9 deletions

View file

@ -171,13 +171,13 @@ If DATE lacks timezone information, GMT is assumed."
(error "Invalid date: %s" date)))))))))
;;;###autoload
(defalias 'time-to-seconds 'float-time)
(defalias 'time-to-seconds #'float-time)
;;;###autoload
(defun seconds-to-time (seconds &rest form)
"Convert SECONDS to a proper time, like `current-time' would.
FORM means the same as in `time-convert'."
(time-convert seconds form))
(defun seconds-to-time (seconds)
"Convert SECONDS to a proper time, like `current-time' would."
;; FIXME: Should we (declare (obsolete time-convert "27.1")) ?
(time-convert seconds 'list))
;;;###autoload
(defun days-to-time (days)
@ -202,7 +202,7 @@ TIME should be either a time value or a date-time string."
(time-subtract nil time))
;;;###autoload
(define-obsolete-function-alias 'subtract-time 'time-subtract "26.1")
(define-obsolete-function-alias 'subtract-time #'time-subtract "26.1")
;;;###autoload
(defun date-to-day (date)

View file

@ -401,6 +401,10 @@ decode_float_time (double t, struct lisp_time *result)
else
{
int scale = double_integer_scale (t);
/* FIXME: `double_integer_scale` often returns values that are
"pessimistic" (i.e. larger than necessary), so 3.5 gets converted
to (7881299347898368 . 2251799813685248) rather than (7 . 2).
On 64bit systems, this should not matter very much, tho. */
eassume (scale < flt_radix_power_size);
if (scale < 0)
@ -1717,8 +1721,6 @@ DEFUN ("time-convert", Ftime_convert, Stime_convert, 1, 2, 0,
doc: /* Convert TIME value to a Lisp timestamp of the given FORM.
Truncate the returned value toward minus infinity.
If FORM is nil, return the same form as `current-time'.
If FORM is a positive integer, return a pair of integers (TICKS . FORM),
where TICKS is the number of clock ticks and FORM is the clock frequency
in ticks per second.
@ -1731,9 +1733,14 @@ If FORM is `integer', return an integer count of seconds.
If FORM is `list', return an integer list (HIGH LOW USEC PSEC), where
HIGH has the most significant bits of the seconds, LOW has the least
significant 16 bits, and USEC and PSEC are the microsecond and
picosecond counts. */)
picosecond counts.
If FORM is nil, the behavior depends on `current-time-list',
but new code should not rely on it. */)
(Lisp_Object time, Lisp_Object form)
{
/* FIXME: Any reason why we don't offer a `float` output format option as
well, since we accept it as input? */
struct lisp_time t;
enum timeform input_form = decode_lisp_time (time, false, &t, 0);
if (NILP (form))