ソースを参照

org-timer: Simplify org-timer-seconds

* lisp/org-timer.el (org-timer-seconds): Simplify.
Kyle Meyer 6 年 前
コミット
c0213eb743
1 ファイル変更3 行追加5 行削除
  1. 3 5
      lisp/org-timer.el

+ 3 - 5
lisp/org-timer.el

@@ -232,11 +232,9 @@ it in the buffer."
 	   (abs (floor (org-timer-seconds))))))
 
 (defun org-timer-seconds ()
-  (if org-timer-countdown-timer
-      (- (float-time org-timer-start-time)
-	 (float-time org-timer-pause-time))
-    (- (float-time org-timer-pause-time)
-       (float-time org-timer-start-time))))
+  (funcall (if org-timer-countdown-timer #'+ #'-)
+	   (- (float-time org-timer-start-time)
+	      (float-time org-timer-pause-time))))
 
 ;;;###autoload
 (defun org-timer-change-times-in-region (beg end delta)