From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Re: no running clock Date: Wed, 03 Oct 2007 21:44:36 +0100 Message-ID: <87ir5orkqz.fsf@bzg.ath.cx> References: <87zlz08iln.fsf@myhost.localdomain> <87ve9o0zl3.fsf@adboyd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IdB5J-0003V6-Vi for emacs-orgmode@gnu.org; Wed, 03 Oct 2007 16:44:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IdB5I-0003Uu-BS for emacs-orgmode@gnu.org; Wed, 03 Oct 2007 16:44:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IdB5I-0003Ur-6O for emacs-orgmode@gnu.org; Wed, 03 Oct 2007 16:44:44 -0400 Received: from hu-out-0506.google.com ([72.14.214.226]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IdB5H-0007tn-Lp for emacs-orgmode@gnu.org; Wed, 03 Oct 2007 16:44:43 -0400 Received: by hu-out-0506.google.com with SMTP id 23so2387317huc for ; Wed, 03 Oct 2007 13:44:41 -0700 (PDT) In-Reply-To: <87ve9o0zl3.fsf@adboyd.com> (J. David Boyd's message of "Wed, 03 Oct 2007 15:26:16 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org david@adboyd.com (J. David Boyd) writes: >> Any idea why this happens ? >> >> Cheers, >> Cezar > > Are you exiting Emacs while the clock is started, then restarting > Emacs, and attempting to clock out of an item? I have seen your error > message when I do that. If you try to kill a buffer with a running clock, Org asks you whether you want to clock out. If you're not in the buffer where the clock runs, you are still able to see whether a clock is running: the clocked heading is displayed in the mode-line. If you still want to check for a running clock before closing Emacs, you could perhaps do this: ------------------------------------------------------------------------ (defun org-check-running-clock-any-buffer () "Check if any Org buffer contains a running clock. If yes, offer to stop it and to save the buffer with the changes." (interactive) (let ((buf (marker-buffer org-clock-marker)) (wcf (current-window-configuration))) (when (and buf (y-or-n-p (format "Clock-out in buffer %s before killing it? " buf))) (switch-to-buffer buf) (org-clock-out) (when (y-or-n-p "Save changed buffer? ") (save-buffer)) (set-window-configuration wcf)))) (defadvice save-buffers-kill-emacs (before org-check-running-clock activate) "Check for a running clock before quitting." (org-check-running-clock-any-buffer)) ------------------------------------------------------------------------ -- Bastien