From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: continuing org-clock after accidental emacs-kill Date: Fri, 08 Jun 2012 22:40:09 +0200 Message-ID: <80obotpmfq.fsf@somewhere.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi, John Wiegley wrote: >>>>>> Mehul Sanghvi 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