diff options
author | Kyle Meyer <kyle@kyleam.com> | 2019-01-31 23:04:06 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2019-01-31 23:04:06 -0500 |
commit | 646d4a5fe977fae6f8c4a08ea0b387b88237d418 (patch) | |
tree | fe7d3943eda12d6e2eccca5b61e08ce023494a86 | |
parent | 683df456a41a2b0e308bdbf746f5db0235a6058a (diff) | |
parent | af7795533ae8530324284b7d557f3a7a709538e4 (diff) | |
download | org-mode-646d4a5fe977fae6f8c4a08ea0b387b88237d418.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org-clock.el | 17 | ||||
-rw-r--r-- | lisp/org-element.el | 7 | ||||
-rw-r--r-- | lisp/org-habit.el | 2 | ||||
-rw-r--r-- | lisp/org-indent.el | 4 | ||||
-rw-r--r-- | lisp/org-timer.el | 2 | ||||
-rw-r--r-- | lisp/org.el | 7 |
6 files changed, 25 insertions, 14 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index ebea1bd..69e44e8 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -943,7 +943,9 @@ CLOCK is a cons cell of the form (MARKER START-TIME)." (org-clock-clock-out clock fail-quietly)) ((org-is-active-clock clock) nil) (t (org-clock-clock-in clock t)))) - ((pred (time-less-p nil)) + ((pred (time-less-p (current-time))) + ;; ^ NOTE: Here and in other `time-less-p' calls, we use + ;; (current-time) rather than nil for Emacs 24 compatibility. (error "RESOLVE-TO must refer to a time in the past")) (_ (when restart (error "RESTART is not valid here")) @@ -1043,7 +1045,10 @@ to be CLOCKED OUT.")))) (and (not (memq char-pressed '(?i ?q))) char-pressed))))) (default (floor (/ (float-time - (time-subtract nil last-valid)) 60))) + ;; NOTE: Here and in other `time-subtract' + ;; calls, we use (current-time) rather than nil + ;; for Emacs 24 compatibility. + (time-subtract (current-time) last-valid)) 60))) (keep (and (memq ch '(?k ?K)) (read-number "Keep how many minutes? " default))) @@ -1080,7 +1085,8 @@ to be CLOCKED OUT.")))) (keep (time-add last-valid (seconds-to-time (* 60 keep)))) (gotback - (time-subtract nil (seconds-to-time (* 60 gotback)))) + (time-subtract (current-time) + (seconds-to-time (* 60 gotback)))) (t (error "Unexpected, please report this as a bug"))) (and gotback last-valid) @@ -1162,7 +1168,7 @@ so long." org-clock-marker (marker-buffer org-clock-marker)) (let* ((org-clock-user-idle-seconds (org-user-idle-seconds)) (org-clock-user-idle-start - (time-subtract nil + (time-subtract (current-time) (seconds-to-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)) @@ -1172,7 +1178,8 @@ so long." (lambda (_) (format "Clocked in & idle for %.1f mins" (/ (float-time - (time-subtract nil org-clock-user-idle-start)) + (time-subtract (current-time) + org-clock-user-idle-start)) 60.0))) org-clock-user-idle-start))))) diff --git a/lisp/org-element.el b/lisp/org-element.el index e2d69a4..5cb0935 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -5117,7 +5117,7 @@ Assume ELEMENT belongs to cache and that a cache is active." TIME-LIMIT is a time value or nil." (and time-limit (or (input-pending-p) - (time-less-p time-limit nil)))) + (time-less-p time-limit (current-time))))) (defsubst org-element--cache-shift-positions (element offset &optional props) "Shift ELEMENT properties relative to buffer positions by OFFSET. @@ -5171,7 +5171,10 @@ updated before current modification are actually submitted." (and next (aref next 0)) threshold (and (not threshold) - (time-add nil + ;; NOTE: Here and in other `time-add' calls, we use + ;; (current-time) rather than nil for Emacs 24 + ;; compatibility. + (time-add (current-time) org-element-cache-sync-duration)) future-change) ;; Request processed. Merge current and next offsets and diff --git a/lisp/org-habit.el b/lisp/org-habit.el index d19075d..af45207 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -406,7 +406,7 @@ current time." "Insert consistency graph for any habitual tasks." (let ((inhibit-read-only t) (buffer-invisibility-spec '(org-link)) - (moment (time-subtract nil + (moment (time-subtract (current-time) (list 0 (* 3600 org-extend-today-until) 0)))) (save-excursion (goto-char (if line (point-at-bol) (point-min))) diff --git a/lisp/org-indent.el b/lisp/org-indent.el index 650a62f..2ac431c 100644 --- a/lisp/org-indent.el +++ b/lisp/org-indent.el @@ -333,7 +333,7 @@ stopped." (let* ((case-fold-search t) (limited-re (org-get-limited-outline-regexp)) (level (or (org-current-level) 0)) - (time-limit (and delay (time-add nil delay)))) + (time-limit (and delay (time-add (current-time) delay)))) ;; For each line, set `line-prefix' and `wrap-prefix' ;; properties depending on the type of line (headline, inline ;; task, item or other). @@ -346,7 +346,7 @@ stopped." ;; In asynchronous mode, take a break of ;; `org-indent-agent-resume-delay' every DELAY to avoid ;; blocking any other idle timer or process output. - ((and delay (time-less-p time-limit nil)) + ((and delay (time-less-p time-limit (current-time))) (setq org-indent-agent-resume-timer (run-with-idle-timer (time-add (current-idle-time) org-indent-agent-resume-delay) diff --git a/lisp/org-timer.el b/lisp/org-timer.el index b8aa0be..6e9fa98 100644 --- a/lisp/org-timer.el +++ b/lisp/org-timer.el @@ -402,7 +402,7 @@ VALUE can be `on', `off', or `paused'." (message "No timer set") (let* ((rtime (decode-time (time-subtract (timer--time org-timer-countdown-timer) - nil))) + (current-time)))) (rsecs (nth 0 rtime)) (rmins (nth 1 rtime))) (message "%d minute(s) %d seconds left before next time out" diff --git a/lisp/org.el b/lisp/org.el index f018d0f..df759f9 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5500,14 +5500,15 @@ the rounding returns a past time." (apply 'encode-time (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r))))) (nthcdr 2 time)))) - (if (and past (< (float-time (time-subtract nil res)) 0)) + (if (and past (< (float-time (time-subtract (current-time) res)) 0)) (seconds-to-time (- (float-time res) (* r 60))) res)))) (defun org-today () "Return today date, considering `org-extend-today-until'." (time-to-days - (time-subtract nil (list 0 (* 3600 org-extend-today-until) 0)))) + (time-subtract (current-time) + (list 0 (* 3600 org-extend-today-until) 0)))) ;;;; Font-Lock stuff, including the activators @@ -12739,7 +12740,7 @@ This function is run automatically after each state change to a DONE state." (let ((nshiftmax 10) (nshift 0)) (while (or (= nshift 0) - (not (time-less-p nil time))) + (not (time-less-p (current-time) time))) (when (= nshiftmax (cl-incf nshift)) (or (y-or-n-p (format "%d repeater intervals were not \ |