浏览代码

Use `org-float-time' instead of `time-to-seconds' in John's patch

Carsten Dominik 16 年之前
父节点
当前提交
a45e7d88c7
共有 2 个文件被更改,包括 11 次插入6 次删除
  1. 5 0
      lisp/ChangeLog
  2. 6 6
      lisp/org-clock.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2009-10-17  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-clock.el (org-clock-resolve, org-resolve-clocks)
+	(org-emacs-idle-seconds): Use `org-float-time' instead of
+	`time-to-seconds'
 
 
 2009-10-17  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-10-17  Carsten Dominik  <carsten.dominik@gmail.com>
 
 

+ 6 - 6
lisp/org-clock.el

@@ -681,13 +681,13 @@ was started."
 					   " [(kK)eep (sS)ubtract (C)ancel]? ")
 					   " [(kK)eep (sS)ubtract (C)ancel]? ")
 				   nil 45)))
 				   nil 45)))
 		char-pressed))))
 		char-pressed))))
-	 (default (floor (/ (time-to-seconds
+	 (default (floor (/ (org-float-time
 			     (time-subtract (current-time) last-valid)) 60)))
 			     (time-subtract (current-time) last-valid)) 60)))
 	 (keep (and (memq ch '(?k ?K))
 	 (keep (and (memq ch '(?k ?K))
 		    (read-number "Keep how many minutes? " default)))
 		    (read-number "Keep how many minutes? " default)))
 	 (subtractp (memq ch '(?s ?S)))
 	 (subtractp (memq ch '(?s ?S)))
-	 (barely-started-p (< (- (time-to-seconds last-valid)
-				 (time-to-seconds (cdr clock))) 45))
+	 (barely-started-p (< (- (org-float-time last-valid)
+				 (org-float-time (cdr clock))) 45))
 	 (start-over (and subtractp barely-started-p)))
 	 (start-over (and subtractp barely-started-p)))
     (if (or (null ch)
     (if (or (null ch)
 	    (not (memq ch '(?k ?K ?s ?S ?C))))
 	    (not (memq ch '(?k ?K ?s ?S ?C))))
@@ -734,8 +734,8 @@ non-dangling (i.e., currently open and valid) clocks."
 			(format
 			(format
 			 "Dangling clock started %d mins ago"
 			 "Dangling clock started %d mins ago"
 			 (floor
 			 (floor
-			  (/ (- (time-to-seconds (current-time))
-				(time-to-seconds (cdr clock))) 60))))))
+			  (/ (- (org-float-time (current-time))
+				(org-float-time (cdr clock))) 60))))))
 		 (or last-valid
 		 (or last-valid
 		     (cdr clock)))))))))))
 		     (cdr clock)))))))))))
 
 
@@ -743,7 +743,7 @@ non-dangling (i.e., currently open and valid) clocks."
   "Return the current Emacs idle time in seconds, or nil if not idle."
   "Return the current Emacs idle time in seconds, or nil if not idle."
   (let ((idle-time (current-idle-time)))
   (let ((idle-time (current-idle-time)))
     (if idle-time
     (if idle-time
-	(time-to-seconds idle-time)
+	(org-float-time idle-time)
       0)))
       0)))
 
 
 (defun org-mac-idle-seconds ()
 (defun org-mac-idle-seconds ()