emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] continuing org-clock after accidental emacs-kill


From: Sebastien Vauban
Subject: Re: [O] continuing org-clock after accidental emacs-kill
Date: Fri, 08 Jun 2012 22:40:09 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.0.97 (windows-nt)

Hi,

John Wiegley wrote:
>>>>>> Mehul Sanghvi <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]