emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* continuing org-clock after accidental emacs-kill
@ 2012-06-08 17:51 Mehul Sanghvi
  2012-06-08 20:11 ` John Wiegley
  2012-06-08 21:38 ` Bernt Hansen
  0 siblings, 2 replies; 4+ messages in thread
From: Mehul Sanghvi @ 2012-06-08 17:51 UTC (permalink / raw)
  To: emacs-orgmode

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 ?


-- 
Mehul N. Sanghvi
email: mehul.sanghvi@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: continuing org-clock after accidental emacs-kill
  2012-06-08 17:51 continuing org-clock after accidental emacs-kill Mehul Sanghvi
@ 2012-06-08 20:11 ` John Wiegley
  2012-06-08 20:40   ` Sebastien Vauban
  2012-06-08 21:38 ` Bernt Hansen
  1 sibling, 1 reply; 4+ messages in thread
From: John Wiegley @ 2012-06-08 20:11 UTC (permalink / raw)
  To: emacs-orgmode

>>>>> Mehul Sanghvi <mehul.sanghvi@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.

John

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: continuing org-clock after accidental emacs-kill
  2012-06-08 20:11 ` John Wiegley
@ 2012-06-08 20:40   ` Sebastien Vauban
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastien Vauban @ 2012-06-08 20:40 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi,

John Wiegley wrote:
>>>>>> Mehul Sanghvi <mehul.sanghvi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: continuing org-clock after accidental emacs-kill
  2012-06-08 17:51 continuing org-clock after accidental emacs-kill Mehul Sanghvi
  2012-06-08 20:11 ` John Wiegley
@ 2012-06-08 21:38 ` Bernt Hansen
  1 sibling, 0 replies; 4+ messages in thread
From: Bernt Hansen @ 2012-06-08 21:38 UTC (permalink / raw)
  To: Mehul Sanghvi; +Cc: emacs-orgmode

Mehul Sanghvi <mehul.sanghvi@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 ?

I have the following settings in my .emacs

--8<---------------cut here---------------start------------->8---
;;
;; Resume clocking tasks when emacs is restarted
(org-clock-persistence-insinuate)
;; Do not prompt to resume an active clock
(setq org-clock-persist-query-resume nil)
;; Save the running clock and all clock history when exiting Emacs, load it on startup
(setq org-clock-persist t)
--8<---------------cut here---------------end--------------->8---

so simply going to the agenda (C-c a a) resumes whatever was running
after I restart emacs.

HTH,
Bernt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-08 21:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-08 17:51 continuing org-clock after accidental emacs-kill Mehul Sanghvi
2012-06-08 20:11 ` John Wiegley
2012-06-08 20:40   ` Sebastien Vauban
2012-06-08 21:38 ` Bernt Hansen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).