Ver código fonte

Merge branch 'maint'

Kyle Meyer 6 anos atrás
pai
commit
646d4a5fe9
6 arquivos alterados com 25 adições e 14 exclusões
  1. 12 5
      lisp/org-clock.el
  2. 5 2
      lisp/org-element.el
  3. 1 1
      lisp/org-habit.el
  4. 2 2
      lisp/org-indent.el
  5. 1 1
      lisp/org-timer.el
  6. 4 3
      lisp/org.el

+ 12 - 5
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)))))
 

+ 5 - 2
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

+ 1 - 1
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)))

+ 2 - 2
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)

+ 1 - 1
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"

+ 4 - 3
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 \