diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/calendar/time-date.el | 5 | ||||
-rw-r--r-- | lisp/emacs-lisp/timer.el | 2 | ||||
-rw-r--r-- | lisp/epa-ks.el | 6 | ||||
-rw-r--r-- | lisp/gnus/nnrss.el | 4 | ||||
-rw-r--r-- | lisp/subr.el | 1 |
5 files changed, 10 insertions, 8 deletions
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 7c99d05dc3f..b80b47a33fa 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -179,7 +179,10 @@ If DATE lacks timezone information, GMT is assumed." ;;;###autoload (defun days-to-time (days) "Convert DAYS into a time value." - (let ((time (time-convert (* 86400 days)))) + ;; FIXME: We should likely just pass `t' to `time-convert'. + ;; All uses I could find in Emacs, GNU ELPA, and NonGNU ELPA can handle + ;; any valid time representation as return value. + (let ((time (time-convert (* 86400 days) 'list))) ;; Traditionally, this returned a two-element list if DAYS was an integer. ;; Keep that tradition if time-convert outputs timestamps in list form. (if (and (integerp days) (consp (cdr time))) diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index aafb2e684f4..b25a040a96c 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -122,7 +122,7 @@ of SECS seconds since the epoch. SECS may be a fraction." (setq ticks (ash ticks 1)) (setq hz (ash hz 1))) (let ((more-ticks (+ ticks trunc-s-ticks))) - (time-convert (cons (- more-ticks (% more-ticks trunc-s-ticks)) hz))))) + (time-convert (cons (- more-ticks (% more-ticks trunc-s-ticks)) hz) t)))) (defun timer-relative-time (time secs &optional usecs psecs) "Advance TIME by SECS seconds. diff --git a/lisp/epa-ks.el b/lisp/epa-ks.el index f41429f7734..7c60b659f0a 100644 --- a/lisp/epa-ks.el +++ b/lisp/epa-ks.el @@ -295,13 +295,11 @@ enough, since keyservers have strict timeout settings." :created (and (match-string 4) (not (string-empty-p (match-string 4))) - (time-convert - (string-to-number (match-string 4)))) + (time-convert (string-to-number (match-string 4)) t)) :expires (and (match-string 5) (not (string-empty-p (match-string 5))) - (time-convert - (string-to-number (match-string 5)))) + (time-convert (string-to-number (match-string 5)) t)) :flags (mapcar (lambda (flag) (cdr (assq flag '((?r revoked) diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index 5047be1a6a5..8c96d3e0678 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el @@ -453,8 +453,8 @@ which RSS 2.0 allows." (let (case-fold-search vector year month day time zone given) (cond ((null date)) ; do nothing for this case ;; if the date is just digits (unix time stamp): - ((string-match "^[0-9]+$" date) - (setq given (time-convert (string-to-number date)))) + ((string-match "\\`[0-9]+\\'" date) + (setq given (time-convert (string-to-number date) t))) ;; RFC 822 ((string-match " [0-9]+ " date) (setq vector (timezone-parse-date date) diff --git a/lisp/subr.el b/lisp/subr.el index 2603b5ad251..4b1fc832da1 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1857,6 +1857,7 @@ be a list of the form returned by `event-start' and `event-end'." (set-advertised-calling-convention 'redirect-frame-focus '(frame focus-frame) "24.3") (set-advertised-calling-convention 'libxml-parse-xml-region '(start end &optional base-url) "27.1") (set-advertised-calling-convention 'libxml-parse-html-region '(start end &optional base-url) "27.1") +(set-advertised-calling-convention 'time-convert '(time form) "29.1") ;;;; Obsolescence declarations for variables, and aliases. |