From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Changing todo status to waiting before clocked out. Date: Sat, 11 Apr 2009 09:09:44 -0400 Message-ID: <87iqlbl4kn.fsf@legolas.norang.ca> References: <59b700510904110528q420228a9y8b1849b460c65caf@mail.gmail.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 1LscyC-0005Bg-DG for emacs-orgmode@gnu.org; Sat, 11 Apr 2009 09:10:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lscy7-000568-Im for emacs-orgmode@gnu.org; Sat, 11 Apr 2009 09:10:03 -0400 Received: from [199.232.76.173] (port=42696 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lscy7-00055x-6g for emacs-orgmode@gnu.org; Sat, 11 Apr 2009 09:09:59 -0400 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:64490) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lscy6-00043R-Tu for emacs-orgmode@gnu.org; Sat, 11 Apr 2009 09:09:59 -0400 In-Reply-To: <59b700510904110528q420228a9y8b1849b460c65caf@mail.gmail.com> (Deric Bytes's message of "Sat\, 11 Apr 2009 13\:28\:06 +0100") 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: Deric Bytes Cc: emacs-orgmode@gnu.org Deric Bytes writes: > How can I change the todo status before an item is clocked out. I was > hoping for something like the following > > > (add-hook 'org-before-todo-state-change-hook > 'dericbytes/org-clock-out-change-status-to-waiting) > > > (defun dericbytes/org-clock-out-change-status-to-waiting () > (save-excursion > (goto-char org-clock-marker) > (org-todo "WAITING"))) The clock does not stop until you move the state to a DONE state. My WAITING state is not a done state so I'm free to move the status from TODO to WAITING and back without affecting the running clock. You can also set 'org-clock-out-when-done' to nil to prevent the clock from stopping when moving to done states as well. HTH, Bernt