1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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:
Paul Eggert 2019-02-10 23:47:43 -08:00
parent 54b9ee77ad
commit 57c74793c4
18 changed files with 45 additions and 45 deletions

View file

@ -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)))))

View file

@ -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

View file

@ -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.")

View file

@ -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))))))

View file

@ -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)