Hi,

John Wiegley wrote:
>>>>>> Mehul Sanghvi <mehul.sang...@gmail.com> writes:
>
>> I was clocked-in and I absentmindedly quit out of emacs without doing a
>> clock-out.  How do I get the clock working and picking up from where it left
>> off ?  Or have I lost what I had for today ?
>
> Type M-x org-resolve-clocks.

And for preventive action, I've this (very similar to what existed in
John's Planner):

#+begin_src emacs-lisp
  ;; ask the user if they wish to clock out before killing Emacs
  (defun my/org-clock-query-out ()
    "Ask the user before clocking out.
  This is a useful function for adding to `kill-emacs-query-functions'."
    (if (and
             (featurep 'org-clock)
             (funcall 'org-clocking-p)
             (y-or-n-p "You are currently clocking time, clock out? "))
        (org-clock-out)
      t)) ;; only fails on keyboard quit or error

  ;; timeclock.el puts this on the wrong hook!
  (add-hook 'kill-emacs-query-functions 'my/org-clock-query-out)
#+end_src

Best regards,
  Seb

-- 
Sebastien Vauban


Reply via email to