Fix J in agenda when clock out hook clocks in again
commitdf0a988a92a4afdc935023e88e50964ce6a852e3
authorBernt Hansen <bernt@norang.ca>
Thu, 9 Feb 2012 22:43:40 +0000 (9 22:43 +0000)
committerDavid Maus <dmaus@ictsoc.de>
Sun, 12 Feb 2012 18:44:23 +0000 (12 19:44 +0100)
tree6e42944bc01717df3fb935d7294ea83dc7f2506c
parent1fd0234a303ec76786ded89b3fc39a81a8fc9af5
Fix J in agenda when clock out hook clocks in again

* org-clock.el (org-clock-out): Do not delete the current clocking task
when org-clock-out-hook clocks in another task

My clock out hook keeps the clock running by automatically clocking in
a new task (the parent task, or the default task).  This sets a new
clocking task which was then clobbered at the end of org-clock-out
so that J in the agenda would return

    "No running clock, use `C-c C-x C-j' to jump to the most recent one"

We now detect that another task is clocked in and skip clearing the
org-clock-current-task variable used by the agenda to determine if
the clock is currently running.
lisp/org-clock.el