org-timer.el: Merge API for the two timers
commit173b0cb6d6d83987d094f1a0dead86e43467bd83
authorKyle Meyer <kyle@kyleam.com>
Sun, 7 Dec 2014 07:24:54 +0000 (7 02:24 -0500)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Tue, 9 Dec 2014 09:13:29 +0000 (9 10:13 +0100)
tree53c65af7b032ca2296df4682fc1b97eb01048382
parentdc460fcad145ff81e22129d50bea2132250c15b2
org-timer.el: Merge API for the two timers

* lisp/org-timer.el (org-timer-stop): Support countdown timers in addition
to relative timers.

* lisp/org-timer.el (org-timer-cancel-timer): Remove function.

* lisp/org-timer.el (org-timer-pause-or-continue): Support countdown
timers in addition to relative timers.

* testing/lisp/test-org-timer.el: New file.

* doc/org.texi: Merge relative and countdown timer nodes.

Several previous issues are fixed with these changes.

- org-timer-set-timer and org-timer-cancel-timer did not reset
  org-timer-start-time after countdown completed.

- Because org-timer-start did not return org-timer-pause-time to nil,
  the modeline remained stuck at the paused time.

- When org-timer-start was called with a countdown timer, the modeline
  was updated for the new relative timer, but the countdown timer
  remained scheduled.

- When org-timer-pause-or-continue was called with a countdown timer
  running, the modeline was put in a paused state, but the countdown
  timer remained scheduled.

- When org-timer-stop was called with a countdown timer running, the
  timer was removed from the modeline, but the countdown timer remained
  scheduled.

- When org-timer-set-timer was called with a paused relative timer, the
  relative timer was not reset properly (org-timer-pause-time was still
  non-nil) and the modeline remained in the paused state of the relative
  timer, even though the countdown timer was scheduled with
  run-with-timer.

- Running org-timer-set-timer at the beginning of an empty buffer
  resulted in an args-out-of-range error (due to the org-get-at-eol
  call).
doc/org.texi
etc/ORG-NEWS
lisp/org-timer.el
testing/lisp/test-org-timer.el [new file with mode: 0644]