summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-02-13 13:02:28 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-02-13 13:02:28 +0100
commit8e9b8dc2eb15e6d762a384ff9d702034d9572fd7 (patch)
treeb959dee2cd190b0aea1e8dd0b2a1951aef725abc
parentc0213eb743005dfd45e940546c0adacb44e38ce7 (diff)
downloadorg-mode-8e9b8dc2eb15e6d762a384ff9d702034d9572fd7.tar.gz
org-timer: Further simplification
* lisp/org-timer.el (org-timer-seconds): Remove function. (org-timer-value-string): Fix docstring. Remove call to `org-timer-seconds'.
-rw-r--r--lisp/org-timer.el11
1 files changed, 4 insertions, 7 deletions
diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index e8dcc0b..aff2853 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -226,15 +226,12 @@ it in the buffer."
(insert (org-timer-value-string)))))
(defun org-timer-value-string ()
- "Set the timer string."
+ "Return current timer string."
(format org-timer-format
(org-timer-secs-to-hms
- (abs (floor (org-timer-seconds))))))
-
-(defun org-timer-seconds ()
- (funcall (if org-timer-countdown-timer #'+ #'-)
- (- (float-time org-timer-start-time)
- (float-time org-timer-pause-time))))
+ (let ((time (- (float-time org-timer-pause-time)
+ (float-time org-timer-start-time))))
+ (abs (floor (if org-timer-countdown-timer (- time) time)))))))
;;;###autoload
(defun org-timer-change-times-in-region (beg end delta)