Prefer encode-time to its alias
* lisp/calendar/icalendar.el, lisp/calendar/timeclock.el: * lisp/emacs-lisp/timer.el, lisp/gnus/gnus-delay.el: * lisp/gnus/gnus-sum.el, lisp/gnus/nndiary.el: * lisp/gnus/nnrss.el, lisp/net/newst-backend.el: * lisp/net/rcirc.el, lisp/obsolete/xesam.el: * lisp/org/org-agenda.el, lisp/org/org-clock.el: * lisp/org/org-element.el, lisp/org/org-timer.el: * lisp/org/org.el, lisp/progmodes/flymake.el: * lisp/url/url-cache.el, lisp/url/url-cookie.el: Use encode-time instead of its alias seconds-to-time.
This commit is contained in:
parent
54b9ee77ad
commit
57c74793c4
18 changed files with 45 additions and 45 deletions
|
@ -1621,7 +1621,7 @@ enumeration, given as a time value, in same format as returned by
|
|||
(mapcar
|
||||
(lambda (offset)
|
||||
(let* ((day (decode-time (time-add now
|
||||
(seconds-to-time
|
||||
(encode-time
|
||||
(* offset 60 60 24)))))
|
||||
(d (nth 3 day))
|
||||
(m (nth 4 day))
|
||||
|
|
|
@ -528,7 +528,7 @@ non-nil, the amount returned will be relative to past time worked."
|
|||
"Return a time value representing the end of today's workday.
|
||||
If TODAY-ONLY is non-nil, the value returned will be relative only to
|
||||
the time worked today, and not to past time."
|
||||
(seconds-to-time
|
||||
(encode-time
|
||||
(- (float-time)
|
||||
(let ((discrep (timeclock-find-discrep)))
|
||||
(if discrep
|
||||
|
@ -1196,7 +1196,7 @@ HTML-P is non-nil, HTML markup is added."
|
|||
(insert project "</b><br>\n")
|
||||
(insert project "*\n"))
|
||||
(let ((proj-data (cdr (assoc project (timeclock-project-alist log))))
|
||||
(two-weeks-ago (seconds-to-time
|
||||
(two-weeks-ago (encode-time
|
||||
(- (float-time today)
|
||||
(* 2 7 24 60 60))))
|
||||
two-week-len today-len)
|
||||
|
@ -1249,16 +1249,16 @@ HTML-P is non-nil, HTML markup is added."
|
|||
<th>-1 year</th>
|
||||
</tr>")
|
||||
(let* ((day-list (timeclock-day-list))
|
||||
(thirty-days-ago (seconds-to-time
|
||||
(thirty-days-ago (encode-time
|
||||
(- (float-time today)
|
||||
(* 30 24 60 60))))
|
||||
(three-months-ago (seconds-to-time
|
||||
(three-months-ago (encode-time
|
||||
(- (float-time today)
|
||||
(* 90 24 60 60))))
|
||||
(six-months-ago (seconds-to-time
|
||||
(six-months-ago (encode-time
|
||||
(- (float-time today)
|
||||
(* 180 24 60 60))))
|
||||
(one-year-ago (seconds-to-time
|
||||
(one-year-ago (encode-time
|
||||
(- (float-time today)
|
||||
(* 365 24 60 60))))
|
||||
(time-in (vector (list t) (list t) (list t) (list t) (list t)))
|
||||
|
|
|
@ -88,7 +88,7 @@ SECS may be an integer, floating point number, or the internal
|
|||
time format returned by, e.g., `current-idle-time'.
|
||||
If optional third argument REPEAT is non-nil, make the timer
|
||||
fire each time Emacs is idle for that many seconds."
|
||||
(setf (timer--time timer) (if (consp secs) secs (seconds-to-time secs)))
|
||||
(setf (timer--time timer) (if (consp secs) secs (encode-time secs)))
|
||||
(setf (timer--repeat-delay timer) repeat)
|
||||
timer)
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ DELAY is a string, giving the length of the time. Possible values are:
|
|||
(setq deadline (+ 86400 deadline))) ; 86400 secs/day
|
||||
;; Convert seconds to date header.
|
||||
(setq deadline (message-make-date
|
||||
(seconds-to-time deadline))))
|
||||
(encode-time deadline))))
|
||||
((string-match "\\([0-9]+\\)\\s-*\\([mhdwMY]\\)" delay)
|
||||
(setq num (match-string 1 delay))
|
||||
(setq unit (match-string 2 delay))
|
||||
|
@ -129,7 +129,7 @@ DELAY is a string, giving the length of the time. Possible values are:
|
|||
(t
|
||||
(setq delay (* num 60))))
|
||||
(setq deadline (message-make-date
|
||||
(seconds-to-time (+ (float-time) delay)))))
|
||||
(encode-time (+ (float-time) delay)))))
|
||||
(t (error "Malformed delay `%s'" delay)))
|
||||
(message-add-header (format "%s: %s" gnus-delay-header deadline)))
|
||||
(set-buffer-modified-p t)
|
||||
|
|
|
@ -3868,7 +3868,7 @@ Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
|
|||
(setq top (eval (caar templist)))))
|
||||
(if (stringp (cdr (car templist)))
|
||||
(setq my-format (cdr (car templist)))))
|
||||
(format-time-string (eval my-format) (seconds-to-time messy-date)))
|
||||
(format-time-string (eval my-format) (encode-time messy-date)))
|
||||
(error " ? ")))
|
||||
|
||||
(defun gnus-summary-set-local-parameters (group)
|
||||
|
|
|
@ -1279,27 +1279,27 @@ all. This may very well take some time.")
|
|||
(cond ((eq (cdr reminder) 'minute)
|
||||
(time-subtract
|
||||
(apply 'encode-time 0 (nthcdr 1 date-elts))
|
||||
(seconds-to-time (* (car reminder) 60.0))))
|
||||
(encode-time (* (car reminder) 60.0))))
|
||||
((eq (cdr reminder) 'hour)
|
||||
(time-subtract
|
||||
(apply 'encode-time 0 0 (nthcdr 2 date-elts))
|
||||
(seconds-to-time (* (car reminder) 3600.0))))
|
||||
(encode-time (* (car reminder) 3600.0))))
|
||||
((eq (cdr reminder) 'day)
|
||||
(time-subtract
|
||||
(apply 'encode-time 0 0 0 (nthcdr 3 date-elts))
|
||||
(seconds-to-time (* (car reminder) 86400.0))))
|
||||
(encode-time (* (car reminder) 86400.0))))
|
||||
((eq (cdr reminder) 'week)
|
||||
(time-subtract
|
||||
(apply 'encode-time 0 0 0 monday (nthcdr 4 date-elts))
|
||||
(seconds-to-time (* (car reminder) 604800.0))))
|
||||
(encode-time (* (car reminder) 604800.0))))
|
||||
((eq (cdr reminder) 'month)
|
||||
(time-subtract
|
||||
(apply 'encode-time 0 0 0 1 (nthcdr 4 date-elts))
|
||||
(seconds-to-time (* (car reminder) 18748800.0))))
|
||||
(encode-time (* (car reminder) 18748800.0))))
|
||||
((eq (cdr reminder) 'year)
|
||||
(time-subtract
|
||||
(apply 'encode-time 0 0 0 1 1 (nthcdr 5 date-elts))
|
||||
(seconds-to-time (* (car reminder) 400861056.0)))))
|
||||
(encode-time (* (car reminder) 400861056.0)))))
|
||||
res))
|
||||
(sort res 'time-less-p)))
|
||||
|
||||
|
|
|
@ -454,7 +454,7 @@ which RSS 2.0 allows."
|
|||
(cond ((null date)) ; do nothing for this case
|
||||
;; if the date is just digits (unix time stamp):
|
||||
((string-match "^[0-9]+$" date)
|
||||
(setq given (seconds-to-time (string-to-number date))))
|
||||
(setq given (encode-time (string-to-number date))))
|
||||
;; RFC822
|
||||
((string-match " [0-9]+ " date)
|
||||
(setq vector (timezone-parse-date date)
|
||||
|
|
|
@ -1802,7 +1802,7 @@ download it from URL first."
|
|||
(time-less-p nil
|
||||
(time-add (file-attribute-modification-time
|
||||
(file-attributes image-name))
|
||||
(seconds-to-time 86400))))
|
||||
(encode-time 86400))))
|
||||
(newsticker--debug-msg "%s: Getting image for %s skipped"
|
||||
(format-time-string "%A, %H:%M")
|
||||
feed-name)
|
||||
|
@ -1996,7 +1996,7 @@ older than TIME."
|
|||
(lambda (item)
|
||||
(when (eq (newsticker--age item) old-age)
|
||||
(let ((exp-time (time-add (newsticker--time item)
|
||||
(seconds-to-time time))))
|
||||
(encode-time time))))
|
||||
(when (time-less-p exp-time nil)
|
||||
(newsticker--debug-msg
|
||||
"Item `%s' from %s has expired on %s"
|
||||
|
|
|
@ -2794,7 +2794,7 @@ the only argument."
|
|||
(let* ((nick (nth 1 args))
|
||||
(idle-secs (string-to-number (nth 2 args)))
|
||||
(idle-string (format-seconds "%yy %dd %hh %mm %z%ss" idle-secs))
|
||||
(signon-time (seconds-to-time (string-to-number (nth 3 args))))
|
||||
(signon-time (encode-time (string-to-number (nth 3 args))))
|
||||
(signon-string (format-time-string "%c" signon-time))
|
||||
(message (format "%s idle for %s, signed on %s"
|
||||
nick idle-string signon-string)))
|
||||
|
@ -2815,7 +2815,7 @@ Not in rfc1459.txt"
|
|||
(with-current-buffer buffer
|
||||
(let ((setter (nth 2 args))
|
||||
(time (current-time-string
|
||||
(seconds-to-time
|
||||
(encode-time
|
||||
(string-to-number (cl-cadddr args))))))
|
||||
(rcirc-print process sender "TOPIC" (cadr args)
|
||||
(format "%s (%s on %s)" rcirc-topic setter time))))))
|
||||
|
|
|
@ -622,7 +622,7 @@ Return propertized STRING."
|
|||
(or (widget-get widget :tag) "")
|
||||
(format-time-string
|
||||
"%d %B %Y, %T"
|
||||
(seconds-to-time
|
||||
(encode-time
|
||||
(string-to-number (widget-get widget :xesam:sourceModified)))))))
|
||||
|
||||
;; Second line: :value.
|
||||
|
|
|
@ -5914,8 +5914,8 @@ See also the user option `org-agenda-clock-consistency-checks'."
|
|||
(throw 'exit t))
|
||||
;; We have a shorter gap.
|
||||
;; Now we have to get the minute of the day when these times are
|
||||
(let* ((t1dec (decode-time (seconds-to-time t1)))
|
||||
(t2dec (decode-time (seconds-to-time t2)))
|
||||
(let* ((t1dec (decode-time (encode-time t1)))
|
||||
(t2dec (decode-time (encode-time t2)))
|
||||
;; compute the minute on the day
|
||||
(min1 (+ (nth 1 t1dec) (* 60 (nth 2 t1dec))))
|
||||
(min2 (+ (nth 1 t2dec) (* 60 (nth 2 t2dec)))))
|
||||
|
|
|
@ -1069,10 +1069,10 @@ to be CLOCKED OUT."))))
|
|||
(and gotback (= gotback default)))
|
||||
'now)
|
||||
(keep
|
||||
(time-add last-valid (seconds-to-time (* 60 keep))))
|
||||
(time-add last-valid (encode-time (* 60 keep))))
|
||||
(gotback
|
||||
(time-subtract (current-time)
|
||||
(seconds-to-time (* 60 gotback))))
|
||||
(encode-time (* 60 gotback))))
|
||||
(t
|
||||
(error "Unexpected, please report this as a bug")))
|
||||
(and gotback last-valid)
|
||||
|
@ -1155,7 +1155,7 @@ so long."
|
|||
(let* ((org-clock-user-idle-seconds (org-user-idle-seconds))
|
||||
(org-clock-user-idle-start
|
||||
(time-subtract (current-time)
|
||||
(seconds-to-time org-clock-user-idle-seconds)))
|
||||
(encode-time org-clock-user-idle-seconds)))
|
||||
(org-clock-resolving-clocks-due-to-idleness t))
|
||||
(if (> org-clock-user-idle-seconds (* 60 org-clock-idle-time))
|
||||
(org-clock-resolve
|
||||
|
@ -2714,14 +2714,14 @@ LEVEL is an integer. Indent by two spaces per level above 1."
|
|||
(setq te (float-time (apply #'encode-time (org-parse-time-string te))))))
|
||||
(setq tsb
|
||||
(if (eq step0 'week)
|
||||
(let ((dow (nth 6 (decode-time (seconds-to-time ts)))))
|
||||
(let ((dow (nth 6 (decode-time (encode-time ts)))))
|
||||
(if (<= dow ws) ts
|
||||
(- ts (* 86400 (- dow ws)))))
|
||||
ts))
|
||||
(while (< tsb te)
|
||||
(unless (bolp) (insert "\n"))
|
||||
(let ((start-time (seconds-to-time (max tsb ts))))
|
||||
(cl-incf tsb (let ((dow (nth 6 (decode-time (seconds-to-time tsb)))))
|
||||
(let ((start-time (encode-time (max tsb ts))))
|
||||
(cl-incf tsb (let ((dow (nth 6 (decode-time (encode-time tsb)))))
|
||||
(if (or (eq step0 'day)
|
||||
(= dow ws))
|
||||
step
|
||||
|
@ -2741,7 +2741,7 @@ LEVEL is an integer. Indent by two spaces per level above 1."
|
|||
:tstart (format-time-string (org-time-stamp-format t t)
|
||||
start-time)
|
||||
:tend (format-time-string (org-time-stamp-format t t)
|
||||
(seconds-to-time (min te tsb))))))))
|
||||
(encode-time (min te tsb))))))))
|
||||
(re-search-forward "^[ \t]*#\\+END:")
|
||||
(when (and stepskip0 (equal step-time 0))
|
||||
;; Remove the empty table
|
||||
|
|
|
@ -4765,13 +4765,13 @@ you want to help debugging the issue.")
|
|||
(defvar org-element-cache-sync-idle-time 0.6
|
||||
"Length, in seconds, of idle time before syncing cache.")
|
||||
|
||||
(defvar org-element-cache-sync-duration (seconds-to-time 0.04)
|
||||
(defvar org-element-cache-sync-duration (encode-time 0.04)
|
||||
"Maximum duration, as a time value, for a cache synchronization.
|
||||
If the synchronization is not over after this delay, the process
|
||||
pauses and resumes after `org-element-cache-sync-break'
|
||||
seconds.")
|
||||
|
||||
(defvar org-element-cache-sync-break (seconds-to-time 0.3)
|
||||
(defvar org-element-cache-sync-break (encode-time 0.3)
|
||||
"Duration, as a time value, of the pause between synchronizations.
|
||||
See `org-element-cache-sync-duration' for more information.")
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ the region 0:00:00."
|
|||
(unless (string-match "\\S-" s) (setq s def))
|
||||
(setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete s)))))
|
||||
(setq org-timer-start-time
|
||||
(seconds-to-time
|
||||
(encode-time
|
||||
;; Pass `current-time' result to `float-time' (instead
|
||||
;; of calling without arguments) so that only
|
||||
;; `current-time' has to be overridden in tests.
|
||||
|
@ -168,12 +168,12 @@ With prefix arg STOP, stop it entirely."
|
|||
(org-timer--run-countdown-timer
|
||||
new-secs org-timer-countdown-timer-title))
|
||||
(setq org-timer-start-time
|
||||
(time-add (current-time) (seconds-to-time new-secs))))
|
||||
(time-add (current-time) (encode-time new-secs))))
|
||||
(setq org-timer-start-time
|
||||
;; Pass `current-time' result to `float-time' (instead
|
||||
;; of calling without arguments) so that only
|
||||
;; `current-time' has to be overridden in tests.
|
||||
(seconds-to-time (- (float-time (current-time))
|
||||
(encode-time (- (float-time (current-time))
|
||||
(- pause-secs start-secs)))))
|
||||
(setq org-timer-pause-time nil)
|
||||
(org-timer-set-mode-line 'on)
|
||||
|
@ -464,7 +464,7 @@ using three `C-u' prefix arguments."
|
|||
secs org-timer-countdown-timer-title))
|
||||
(run-hooks 'org-timer-set-hook)
|
||||
(setq org-timer-start-time
|
||||
(time-add (current-time) (seconds-to-time secs)))
|
||||
(time-add (current-time) (encode-time secs)))
|
||||
(setq org-timer-pause-time nil)
|
||||
(org-timer-set-mode-line 'on))))))
|
||||
|
||||
|
|
|
@ -5621,7 +5621,7 @@ the rounding returns a past time."
|
|||
(append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r)))))
|
||||
(nthcdr 2 time))))
|
||||
(if (and past (< (float-time (time-subtract (current-time) res)) 0))
|
||||
(seconds-to-time (- (float-time res) (* r 60)))
|
||||
(encode-time (- (float-time res) (* r 60)))
|
||||
res))))
|
||||
|
||||
(defun org-today ()
|
||||
|
@ -17796,7 +17796,7 @@ NODEFAULT, hour and minute fields will be nil if not given."
|
|||
;; second argument. However, this requires at least Emacs
|
||||
;; 25.1. We can do it when we switch to this version as our
|
||||
;; minimal requirement.
|
||||
(decode-time (seconds-to-time (org-matcher-time s))))
|
||||
(decode-time (encode-time (org-matcher-time s))))
|
||||
(t (error "Not a standard Org time string: %s" s))))
|
||||
|
||||
(defun org-timestamp-up (&optional arg)
|
||||
|
|
|
@ -1004,7 +1004,7 @@ Do it only if `flymake-no-changes-timeout' is non-nil."
|
|||
(setq
|
||||
flymake-timer
|
||||
(run-with-idle-timer
|
||||
(seconds-to-time flymake-no-changes-timeout)
|
||||
(encode-time flymake-no-changes-timeout)
|
||||
nil
|
||||
(lambda (buffer)
|
||||
(when (buffer-live-p buffer)
|
||||
|
|
|
@ -205,7 +205,7 @@ If `url-standalone-mode' is non-nil, cached items never expire."
|
|||
(time-less-p
|
||||
(time-add
|
||||
cache-time
|
||||
(seconds-to-time (or expire-time url-cache-expire-time)))
|
||||
(encode-time (or expire-time url-cache-expire-time)))
|
||||
nil)))))
|
||||
|
||||
(defun url-cache-prune-cache (&optional directory)
|
||||
|
@ -227,7 +227,7 @@ considered \"expired\"."
|
|||
((time-less-p
|
||||
(time-add
|
||||
(file-attribute-modification-time (file-attributes file))
|
||||
(seconds-to-time url-cache-expire-time))
|
||||
(encode-time url-cache-expire-time))
|
||||
now)
|
||||
(delete-file file)
|
||||
(setq deleted-files (1+ deleted-files))))))
|
||||
|
|
|
@ -105,10 +105,10 @@ i.e. 1970-1-1) are loaded as expiring one year from now instead."
|
|||
;; away, make it expire a year from now
|
||||
(expires (format-time-string
|
||||
"%d %b %Y %T [GMT]"
|
||||
(seconds-to-time
|
||||
(encode-time
|
||||
(let ((s (string-to-number (nth 4 fields))))
|
||||
(if (and (= s 0) long-session)
|
||||
(seconds-to-time (+ (* 365 24 60 60) (float-time)))
|
||||
(encode-time (+ (* 365 24 60 60) (float-time)))
|
||||
s)))))
|
||||
(key (nth 5 fields))
|
||||
(val (nth 6 fields)))
|
||||
|
|
Loading…
Add table
Reference in a new issue