diff options
| author | Paul Eggert | 2019-02-10 23:47:43 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-02-10 23:54:34 -0800 |
| commit | 57c74793c46c6533b63836f00aecaf3ac2accb6d (patch) | |
| tree | 5ceb3f9e765c4240069f92653d1648ca1137887c /lisp/org | |
| parent | 54b9ee77adca44299fe8f4342498a082608b4d1b (diff) | |
| download | emacs-57c74793c46c6533b63836f00aecaf3ac2accb6d.tar.gz emacs-57c74793c46c6533b63836f00aecaf3ac2accb6d.zip | |
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.
Diffstat (limited to 'lisp/org')
| -rw-r--r-- | lisp/org/org-agenda.el | 4 | ||||
| -rw-r--r-- | lisp/org/org-clock.el | 14 | ||||
| -rw-r--r-- | lisp/org/org-element.el | 4 | ||||
| -rw-r--r-- | lisp/org/org-timer.el | 8 | ||||
| -rw-r--r-- | lisp/org/org.el | 4 |
5 files changed, 17 insertions, 17 deletions
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 6f66807ab57..6cc5214306a 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el | |||
| @@ -5914,8 +5914,8 @@ See also the user option `org-agenda-clock-consistency-checks'." | |||
| 5914 | (throw 'exit t)) | 5914 | (throw 'exit t)) |
| 5915 | ;; We have a shorter gap. | 5915 | ;; We have a shorter gap. |
| 5916 | ;; Now we have to get the minute of the day when these times are | 5916 | ;; Now we have to get the minute of the day when these times are |
| 5917 | (let* ((t1dec (decode-time (seconds-to-time t1))) | 5917 | (let* ((t1dec (decode-time (encode-time t1))) |
| 5918 | (t2dec (decode-time (seconds-to-time t2))) | 5918 | (t2dec (decode-time (encode-time t2))) |
| 5919 | ;; compute the minute on the day | 5919 | ;; compute the minute on the day |
| 5920 | (min1 (+ (nth 1 t1dec) (* 60 (nth 2 t1dec)))) | 5920 | (min1 (+ (nth 1 t1dec) (* 60 (nth 2 t1dec)))) |
| 5921 | (min2 (+ (nth 1 t2dec) (* 60 (nth 2 t2dec))))) | 5921 | (min2 (+ (nth 1 t2dec) (* 60 (nth 2 t2dec))))) |
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index 9d05c836da7..b177450d33f 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el | |||
| @@ -1069,10 +1069,10 @@ to be CLOCKED OUT.")))) | |||
| 1069 | (and gotback (= gotback default))) | 1069 | (and gotback (= gotback default))) |
| 1070 | 'now) | 1070 | 'now) |
| 1071 | (keep | 1071 | (keep |
| 1072 | (time-add last-valid (seconds-to-time (* 60 keep)))) | 1072 | (time-add last-valid (encode-time (* 60 keep)))) |
| 1073 | (gotback | 1073 | (gotback |
| 1074 | (time-subtract (current-time) | 1074 | (time-subtract (current-time) |
| 1075 | (seconds-to-time (* 60 gotback)))) | 1075 | (encode-time (* 60 gotback)))) |
| 1076 | (t | 1076 | (t |
| 1077 | (error "Unexpected, please report this as a bug"))) | 1077 | (error "Unexpected, please report this as a bug"))) |
| 1078 | (and gotback last-valid) | 1078 | (and gotback last-valid) |
| @@ -1155,7 +1155,7 @@ so long." | |||
| 1155 | (let* ((org-clock-user-idle-seconds (org-user-idle-seconds)) | 1155 | (let* ((org-clock-user-idle-seconds (org-user-idle-seconds)) |
| 1156 | (org-clock-user-idle-start | 1156 | (org-clock-user-idle-start |
| 1157 | (time-subtract (current-time) | 1157 | (time-subtract (current-time) |
| 1158 | (seconds-to-time org-clock-user-idle-seconds))) | 1158 | (encode-time org-clock-user-idle-seconds))) |
| 1159 | (org-clock-resolving-clocks-due-to-idleness t)) | 1159 | (org-clock-resolving-clocks-due-to-idleness t)) |
| 1160 | (if (> org-clock-user-idle-seconds (* 60 org-clock-idle-time)) | 1160 | (if (> org-clock-user-idle-seconds (* 60 org-clock-idle-time)) |
| 1161 | (org-clock-resolve | 1161 | (org-clock-resolve |
| @@ -2714,14 +2714,14 @@ LEVEL is an integer. Indent by two spaces per level above 1." | |||
| 2714 | (setq te (float-time (apply #'encode-time (org-parse-time-string te)))))) | 2714 | (setq te (float-time (apply #'encode-time (org-parse-time-string te)))))) |
| 2715 | (setq tsb | 2715 | (setq tsb |
| 2716 | (if (eq step0 'week) | 2716 | (if (eq step0 'week) |
| 2717 | (let ((dow (nth 6 (decode-time (seconds-to-time ts))))) | 2717 | (let ((dow (nth 6 (decode-time (encode-time ts))))) |
| 2718 | (if (<= dow ws) ts | 2718 | (if (<= dow ws) ts |
| 2719 | (- ts (* 86400 (- dow ws))))) | 2719 | (- ts (* 86400 (- dow ws))))) |
| 2720 | ts)) | 2720 | ts)) |
| 2721 | (while (< tsb te) | 2721 | (while (< tsb te) |
| 2722 | (unless (bolp) (insert "\n")) | 2722 | (unless (bolp) (insert "\n")) |
| 2723 | (let ((start-time (seconds-to-time (max tsb ts)))) | 2723 | (let ((start-time (encode-time (max tsb ts)))) |
| 2724 | (cl-incf tsb (let ((dow (nth 6 (decode-time (seconds-to-time tsb))))) | 2724 | (cl-incf tsb (let ((dow (nth 6 (decode-time (encode-time tsb))))) |
| 2725 | (if (or (eq step0 'day) | 2725 | (if (or (eq step0 'day) |
| 2726 | (= dow ws)) | 2726 | (= dow ws)) |
| 2727 | step | 2727 | step |
| @@ -2741,7 +2741,7 @@ LEVEL is an integer. Indent by two spaces per level above 1." | |||
| 2741 | :tstart (format-time-string (org-time-stamp-format t t) | 2741 | :tstart (format-time-string (org-time-stamp-format t t) |
| 2742 | start-time) | 2742 | start-time) |
| 2743 | :tend (format-time-string (org-time-stamp-format t t) | 2743 | :tend (format-time-string (org-time-stamp-format t t) |
| 2744 | (seconds-to-time (min te tsb)))))))) | 2744 | (encode-time (min te tsb)))))))) |
| 2745 | (re-search-forward "^[ \t]*#\\+END:") | 2745 | (re-search-forward "^[ \t]*#\\+END:") |
| 2746 | (when (and stepskip0 (equal step-time 0)) | 2746 | (when (and stepskip0 (equal step-time 0)) |
| 2747 | ;; Remove the empty table | 2747 | ;; Remove the empty table |
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index 75d46e2312c..e2ee0a0fe82 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el | |||
| @@ -4765,13 +4765,13 @@ you want to help debugging the issue.") | |||
| 4765 | (defvar org-element-cache-sync-idle-time 0.6 | 4765 | (defvar org-element-cache-sync-idle-time 0.6 |
| 4766 | "Length, in seconds, of idle time before syncing cache.") | 4766 | "Length, in seconds, of idle time before syncing cache.") |
| 4767 | 4767 | ||
| 4768 | (defvar org-element-cache-sync-duration (seconds-to-time 0.04) | 4768 | (defvar org-element-cache-sync-duration (encode-time 0.04) |
| 4769 | "Maximum duration, as a time value, for a cache synchronization. | 4769 | "Maximum duration, as a time value, for a cache synchronization. |
| 4770 | If the synchronization is not over after this delay, the process | 4770 | If the synchronization is not over after this delay, the process |
| 4771 | pauses and resumes after `org-element-cache-sync-break' | 4771 | pauses and resumes after `org-element-cache-sync-break' |
| 4772 | seconds.") | 4772 | seconds.") |
| 4773 | 4773 | ||
| 4774 | (defvar org-element-cache-sync-break (seconds-to-time 0.3) | 4774 | (defvar org-element-cache-sync-break (encode-time 0.3) |
| 4775 | "Duration, as a time value, of the pause between synchronizations. | 4775 | "Duration, as a time value, of the pause between synchronizations. |
| 4776 | See `org-element-cache-sync-duration' for more information.") | 4776 | See `org-element-cache-sync-duration' for more information.") |
| 4777 | 4777 | ||
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el index bf17de4b03e..c9ca85c0c39 100644 --- a/lisp/org/org-timer.el +++ b/lisp/org/org-timer.el | |||
| @@ -140,7 +140,7 @@ the region 0:00:00." | |||
| 140 | (unless (string-match "\\S-" s) (setq s def)) | 140 | (unless (string-match "\\S-" s) (setq s def)) |
| 141 | (setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete s))))) | 141 | (setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete s))))) |
| 142 | (setq org-timer-start-time | 142 | (setq org-timer-start-time |
| 143 | (seconds-to-time | 143 | (encode-time |
| 144 | ;; Pass `current-time' result to `float-time' (instead | 144 | ;; Pass `current-time' result to `float-time' (instead |
| 145 | ;; of calling without arguments) so that only | 145 | ;; of calling without arguments) so that only |
| 146 | ;; `current-time' has to be overridden in tests. | 146 | ;; `current-time' has to be overridden in tests. |
| @@ -168,12 +168,12 @@ With prefix arg STOP, stop it entirely." | |||
| 168 | (org-timer--run-countdown-timer | 168 | (org-timer--run-countdown-timer |
| 169 | new-secs org-timer-countdown-timer-title)) | 169 | new-secs org-timer-countdown-timer-title)) |
| 170 | (setq org-timer-start-time | 170 | (setq org-timer-start-time |
| 171 | (time-add (current-time) (seconds-to-time new-secs)))) | 171 | (time-add (current-time) (encode-time new-secs)))) |
| 172 | (setq org-timer-start-time | 172 | (setq org-timer-start-time |
| 173 | ;; Pass `current-time' result to `float-time' (instead | 173 | ;; Pass `current-time' result to `float-time' (instead |
| 174 | ;; of calling without arguments) so that only | 174 | ;; of calling without arguments) so that only |
| 175 | ;; `current-time' has to be overridden in tests. | 175 | ;; `current-time' has to be overridden in tests. |
| 176 | (seconds-to-time (- (float-time (current-time)) | 176 | (encode-time (- (float-time (current-time)) |
| 177 | (- pause-secs start-secs))))) | 177 | (- pause-secs start-secs))))) |
| 178 | (setq org-timer-pause-time nil) | 178 | (setq org-timer-pause-time nil) |
| 179 | (org-timer-set-mode-line 'on) | 179 | (org-timer-set-mode-line 'on) |
| @@ -464,7 +464,7 @@ using three `C-u' prefix arguments." | |||
| 464 | secs org-timer-countdown-timer-title)) | 464 | secs org-timer-countdown-timer-title)) |
| 465 | (run-hooks 'org-timer-set-hook) | 465 | (run-hooks 'org-timer-set-hook) |
| 466 | (setq org-timer-start-time | 466 | (setq org-timer-start-time |
| 467 | (time-add (current-time) (seconds-to-time secs))) | 467 | (time-add (current-time) (encode-time secs))) |
| 468 | (setq org-timer-pause-time nil) | 468 | (setq org-timer-pause-time nil) |
| 469 | (org-timer-set-mode-line 'on)))))) | 469 | (org-timer-set-mode-line 'on)))))) |
| 470 | 470 | ||
diff --git a/lisp/org/org.el b/lisp/org/org.el index ef45ee66158..91a4799a21a 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el | |||
| @@ -5621,7 +5621,7 @@ the rounding returns a past time." | |||
| 5621 | (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r))))) | 5621 | (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r))))) |
| 5622 | (nthcdr 2 time)))) | 5622 | (nthcdr 2 time)))) |
| 5623 | (if (and past (< (float-time (time-subtract (current-time) res)) 0)) | 5623 | (if (and past (< (float-time (time-subtract (current-time) res)) 0)) |
| 5624 | (seconds-to-time (- (float-time res) (* r 60))) | 5624 | (encode-time (- (float-time res) (* r 60))) |
| 5625 | res)))) | 5625 | res)))) |
| 5626 | 5626 | ||
| 5627 | (defun org-today () | 5627 | (defun org-today () |
| @@ -17796,7 +17796,7 @@ NODEFAULT, hour and minute fields will be nil if not given." | |||
| 17796 | ;; second argument. However, this requires at least Emacs | 17796 | ;; second argument. However, this requires at least Emacs |
| 17797 | ;; 25.1. We can do it when we switch to this version as our | 17797 | ;; 25.1. We can do it when we switch to this version as our |
| 17798 | ;; minimal requirement. | 17798 | ;; minimal requirement. |
| 17799 | (decode-time (seconds-to-time (org-matcher-time s)))) | 17799 | (decode-time (encode-time (org-matcher-time s)))) |
| 17800 | (t (error "Not a standard Org time string: %s" s)))) | 17800 | (t (error "Not a standard Org time string: %s" s)))) |
| 17801 | 17801 | ||
| 17802 | (defun org-timestamp-up (&optional arg) | 17802 | (defun org-timestamp-up (&optional arg) |