|
@@ -732,8 +732,9 @@ menu\nmouse-2 will jump to task"))
|
|
|
The time returned includes the time spent on this task in
|
|
|
previous clocking intervals."
|
|
|
(let ((currently-clocked-time
|
|
|
- (floor (- (float-time)
|
|
|
- (float-time org-clock-start-time)) 60)))
|
|
|
+ (floor (org-time-convert-to-integer
|
|
|
+ (org-time-since org-clock-start-time))
|
|
|
+ 60)))
|
|
|
(+ currently-clocked-time (or org-clock-total-time 0))))
|
|
|
|
|
|
(defun org-clock-modify-effort-estimate (&optional value)
|
|
@@ -948,9 +949,7 @@ 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 (current-time)))
|
|
|
- ;; ^ NOTE: Here and in other `time-less-p' calls, we use
|
|
|
- ;; (current-time) rather than nil for Emacs 24 compatibility.
|
|
|
+ ((pred (org-time-less-p nil))
|
|
|
(error "RESOLVE-TO must refer to a time in the past"))
|
|
|
(_
|
|
|
(when restart (error "RESTART is not valid here"))
|
|
@@ -1049,11 +1048,8 @@ to be CLOCKED OUT."))))
|
|
|
nil 45)))
|
|
|
(and (not (memq char-pressed '(?i ?q))) char-pressed)))))
|
|
|
(default
|
|
|
- (floor (/ (float-time
|
|
|
- ;; 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)))
|
|
|
+ (floor (org-time-convert-to-integer (org-time-since last-valid))
|
|
|
+ 60))
|
|
|
(keep
|
|
|
(and (memq ch '(?k ?K))
|
|
|
(read-number "Keep how many minutes? " default)))
|
|
@@ -1061,8 +1057,9 @@ to be CLOCKED OUT."))))
|
|
|
(and (memq ch '(?g ?G))
|
|
|
(read-number "Got back how many minutes ago? " default)))
|
|
|
(subtractp (memq ch '(?s ?S)))
|
|
|
- (barely-started-p (< (- (float-time last-valid)
|
|
|
- (float-time (cdr clock))) 45))
|
|
|
+ (barely-started-p (org-time-less-p
|
|
|
+ (org-time-subtract last-valid (cdr clock))
|
|
|
+ 45))
|
|
|
(start-over (and subtractp barely-started-p)))
|
|
|
(cond
|
|
|
((memq ch '(?j ?J))
|
|
@@ -1088,10 +1085,9 @@ to be CLOCKED OUT."))))
|
|
|
(and gotback (= gotback default)))
|
|
|
'now)
|
|
|
(keep
|
|
|
- (time-add last-valid (seconds-to-time (* 60 keep))))
|
|
|
+ (org-time-add last-valid (* 60 keep)))
|
|
|
(gotback
|
|
|
- (time-subtract (current-time)
|
|
|
- (seconds-to-time (* 60 gotback))))
|
|
|
+ (org-time-since (* 60 gotback)))
|
|
|
(t
|
|
|
(error "Unexpected, please report this as a bug")))
|
|
|
(and gotback last-valid)
|
|
@@ -1121,9 +1117,9 @@ If `only-dangling-p' is non-nil, only ask to resolve dangling
|
|
|
(lambda (clock)
|
|
|
(format
|
|
|
"Dangling clock started %d mins ago"
|
|
|
- (floor (- (float-time)
|
|
|
- (float-time (cdr clock)))
|
|
|
- 60)))))
|
|
|
+ (floor (org-time-convert-to-integer
|
|
|
+ (org-time-since (cdr clock)))
|
|
|
+ 60)))))
|
|
|
(or last-valid
|
|
|
(cdr clock)))))))))))
|
|
|
|
|
@@ -1173,7 +1169,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-since (seconds-to-time org-clock-user-idle-seconds)))
|
|
|
+ (org-time-since 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
|
|
@@ -1304,8 +1300,7 @@ the default behavior."
|
|
|
(setq ts (concat "[" (match-string 1) "]"))
|
|
|
(goto-char (match-end 1))
|
|
|
(setq org-clock-start-time
|
|
|
- (apply 'encode-time
|
|
|
- (org-parse-time-string (match-string 1))))
|
|
|
+ (org-time-string-to-time (match-string 1)))
|
|
|
(setq org-clock-effort (org-entry-get (point) org-effort-property))
|
|
|
(setq org-clock-total-time (org-clock-sum-current-item
|
|
|
(org-clock-get-sum-start))))
|
|
@@ -1335,9 +1330,10 @@ the default behavior."
|
|
|
(y-or-n-p
|
|
|
(format
|
|
|
"You stopped another clock %d mins ago; start this one from then? "
|
|
|
- (/ (- (float-time
|
|
|
- (org-current-time org-clock-rounding-minutes t))
|
|
|
- (float-time leftover))
|
|
|
+ (/ (org-time-convert-to-integer
|
|
|
+ (org-time-subtract
|
|
|
+ (org-current-time org-clock-rounding-minutes t)
|
|
|
+ leftover))
|
|
|
60)))
|
|
|
leftover)
|
|
|
start-time
|
|
@@ -1443,7 +1439,7 @@ The time is always returned as UTC."
|
|
|
(day (nth 3 dt)))
|
|
|
(if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day)))
|
|
|
(setf (nth 2 dt) org-extend-today-until)
|
|
|
- (apply #'encode-time (append (list 0 0) (nthcdr 2 dt)))))
|
|
|
+ (apply #'encode-time 0 0 (nthcdr 2 dt))))
|
|
|
((or (equal cmt "all")
|
|
|
(and (or (not cmt) (equal cmt "auto"))
|
|
|
(not lr)))
|
|
@@ -1597,14 +1593,12 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
|
|
|
(delete-region (point) (point-at-eol))
|
|
|
(insert "--")
|
|
|
(setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
|
|
|
- (setq s (- (float-time
|
|
|
- (apply #'encode-time (org-parse-time-string te)))
|
|
|
- (float-time
|
|
|
- (apply #'encode-time (org-parse-time-string ts))))
|
|
|
- h (floor (/ s 3600))
|
|
|
- s (- s (* 3600 h))
|
|
|
- m (floor (/ s 60))
|
|
|
- s (- s (* 60 s)))
|
|
|
+ (setq s (org-time-convert-to-integer
|
|
|
+ (time-subtract
|
|
|
+ (org-time-string-to-time te)
|
|
|
+ (org-time-string-to-time ts)))
|
|
|
+ h (floor s 3600)
|
|
|
+ m (floor (mod s 3600) 60))
|
|
|
(insert " => " (format "%2d:%02d" h m))
|
|
|
(move-marker org-clock-marker nil)
|
|
|
(move-marker org-clock-hd-marker nil)
|
|
@@ -1842,7 +1836,7 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
|
|
|
(org-parse-time-string (match-string 3)))))
|
|
|
(dt (- (if tend (min te tend) te)
|
|
|
(if tstart (max ts tstart) ts))))
|
|
|
- (when (> dt 0) (cl-incf t1 (floor (/ dt 60))))))
|
|
|
+ (when (> dt 0) (cl-incf t1 (floor dt 60)))))
|
|
|
((match-end 4)
|
|
|
;; A naked time.
|
|
|
(setq t1 (+ t1 (string-to-number (match-string 5))
|
|
@@ -1856,8 +1850,8 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
|
|
|
tend
|
|
|
(>= (float-time org-clock-start-time) tstart)
|
|
|
(<= (float-time org-clock-start-time) tend))
|
|
|
- (let ((time (floor (- (float-time)
|
|
|
- (float-time org-clock-start-time))
|
|
|
+ (let ((time (floor (org-time-convert-to-integer
|
|
|
+ (org-time-since org-clock-start-time))
|
|
|
60)))
|
|
|
(setq t1 (+ t1 time))))
|
|
|
(let* ((headline-forced
|
|
@@ -2932,8 +2926,7 @@ Otherwise, return nil."
|
|
|
(<= org-clock-marker (point-at-eol)))
|
|
|
;; The clock is running here
|
|
|
(setq org-clock-start-time
|
|
|
- (apply 'encode-time
|
|
|
- (org-parse-time-string (match-string 1))))
|
|
|
+ (org-time-string-to-time (match-string 1)))
|
|
|
(org-clock-update-mode-line)))
|
|
|
(t
|
|
|
(and (match-end 4) (delete-region (match-beginning 4) (match-end 4)))
|