|The Org Mode 7 Reference Manual
by Carsten Dominik and others
Paperback (6"x9"), 282 pages
RRP £9.95 ($14.95)
Sales of this book support the Org project! Get a printed copy>>>
8.5 Resolving idle time
If you clock in on a work item, and then walk away from your computer--perhaps to take a phone call--you often need to “resolve” the time you were away by either subtracting it from the current clock, or applying it to another one.
By customizing the variable
org-clock-idle-time to some integer, such
as 10 or 15, Emacs can alert you when you get back to your computer after
being idle for that many minutes,(67) and ask what you want to do with the idle time. There will be a
question waiting for you when you get back, indicating how much idle time has
passed (constantly updated with the current amount), as well as a set of
choices to correct the discrepancy:
- To keep some or all of the minutes and stay clocked in, press k. Org will ask how many of the minutes to keep. Press RET to keep them all, effectively changing nothing, or enter a number to keep that many minutes.
- If you use the shift key and press K, it will keep however many minutes you request and then immediately clock out of that task. If you keep all of the minutes, this is the same as just clocking out of the current task.
- To keep none of the minutes, use s to subtract all the away time from the clock, and then check back in from the moment you returned.
- To keep none of the minutes and just clock out at the start of the away time, use the shift key and press S. Remember that using shift will always leave you clocked out, no matter which option you choose.
- To cancel the clock altogether, use C. Note that if instead of canceling you subtract the away time, and the resulting clock amount is less than a minute, the clock will still be canceled rather than clutter up the log with an empty entry.
What if you subtracted those away minutes from the current clock, and now want to apply them to a new clock? Simply clock in to any task immediately after the subtraction. Org will notice that you have subtracted time “on the books”, so to speak, and will ask if you want to apply those minutes to the next task you clock in on.
There is one other instance when this clock resolution magic occurs. Say you were clocked in and hacking away, and suddenly your cat chased a mouse who scared a hamster that crashed into your UPS's power button! You suddenly lose all your buffers, but thanks to auto-save you still have your recent Org mode changes, including your last clock in.
If you restart Emacs and clock into any task, Org will notice that you have a dangling clock which was never clocked out from your last session. Using that clock's starting time as the beginning of the unaccounted-for period, Org will ask how you want to resolve that time. The logic and behavior is identical to dealing with away time due to idleness; it's just happening due to a recovery event rather than a set amount of idle time.
You can also check all the files visited by your Org agenda for dangling clocks at any time using M-x org-resolve-clocks.
|ISBN 9781906966089||The Org Mode 7 Reference Manual||See the print edition|