diff options
author | Marco Wahl <marcowahlsoft@gmail.com> | 2017-07-05 12:33:47 +0200 |
---|---|---|
committer | Marco Wahl <marcowahlsoft@gmail.com> | 2017-07-05 12:33:47 +0200 |
commit | 2b5ce91b35e072ad9ab9462042d1a3cf9b3a223a (patch) | |
tree | 841acb56a42296dc9fa4eafa8a3e7f9009ec24f3 | |
parent | acabacaa5689f0644a47edae7c66bbdd68418194 (diff) | |
download | org-mode-2b5ce91b35e072ad9ab9462042d1a3cf9b3a223a.tar.gz |
org-timer: Fix timer setting from effort property
Testcase included.
-rw-r--r-- | lisp/org-timer.el | 2 | ||||
-rw-r--r-- | testing/lisp/test-org-timer.el | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/lisp/org-timer.el b/lisp/org-timer.el index 146775b..5585f1c 100644 --- a/lisp/org-timer.el +++ b/lisp/org-timer.el @@ -436,7 +436,7 @@ using three `C-u' prefix arguments." (if (numberp org-timer-default-timer) (number-to-string org-timer-default-timer) org-timer-default-timer)) - (effort-minutes (ignore-errors (org-get-at-eol 'effort-minutes 1))) + (effort-minutes (ignore-errors (floor (org-get-at-eol 'effort-minutes 1)))) (minutes (or (and (numberp opt) (number-to-string opt)) (and (not (equal opt '(64))) effort-minutes diff --git a/testing/lisp/test-org-timer.el b/testing/lisp/test-org-timer.el index 8abbb85..9c0aba9 100644 --- a/testing/lisp/test-org-timer.el +++ b/testing/lisp/test-org-timer.el @@ -279,5 +279,21 @@ Also, mute output from `message'." (org-timer-start)) :type (list 'error 'user-error))) +(ert-deftest test-org-timer/set-timer-from-effort-prop () + "Test timer setting from effort property." + (should + (< (* 60 9) ; 9m + (test-org-timer/with-temp-text + "* foo +:PROPERTIES: +:Effort: 10 +:END:" + (org-mode) + (org-timer-set-timer) + (org-timer-hms-to-secs (org-timer nil t))) + (1+ (* 60 10)) ; 10m 1s + ))) + + (provide 'test-org-timer) ;;; test-org-timer.el end here |