From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manish Subject: Re: Re: clock and WAIT Date: Fri, 15 Jan 2010 23:47:25 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NVqk5-0001ri-3C for emacs-orgmode@gnu.org; Fri, 15 Jan 2010 13:17:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NVqk0-0001oV-J4 for emacs-orgmode@gnu.org; Fri, 15 Jan 2010 13:17:52 -0500 Received: from [199.232.76.173] (port=49080 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVqk0-0001oJ-71 for emacs-orgmode@gnu.org; Fri, 15 Jan 2010 13:17:48 -0500 Received: from mx20.gnu.org ([199.232.41.8]:33301) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NVqjz-0006R4-Ve for emacs-orgmode@gnu.org; Fri, 15 Jan 2010 13:17:48 -0500 Received: from mail-iw0-f187.google.com ([209.85.223.187]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NVqjz-00029Z-CA for emacs-orgmode@gnu.org; Fri, 15 Jan 2010 13:17:47 -0500 Received: by iwn17 with SMTP id 17so736227iwn.25 for ; Fri, 15 Jan 2010 10:17:45 -0800 (PST) In-Reply-To: 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: Richard Riley Cc: emacs-orgmode@gnu.org On Fri, Jan 15, 2010 at 10:40 PM, Richard Riley wrote: > Manish writes: > >> On Fri, Jan 15, 2010 at 4:52 PM, Richard Riley wrote: >>> >>> When I put a task into certain states it would be nice to stop the clock >>> automatically. It is done for DONE at the moment. >>> >>> Would it make sense to make >>> >>> org-clock-out-when-done >>> >>> a list of state names rather than (or in addition to) a bool? >>> >>> That way I could make it DONE, WAIT so when I cycle the state to WAIT (eg for >>> an email confirming something works) the clock is stopped automatically? >>> >>> Or is there another mechanism for this? Or is the mantra more to keep >>> stop/start manual until the obvious state for "DONE"? >>> >> >> Not for a list of states but it can be done for at least one state. >> See variable org-clock-out-switch-to-state. >> >> HTH > > Thats a different issue. That determines which state the task is > automatically switched to when you actually remember to clock out. You are right. I misunderstood. Sorry. > > I'm not sure I would find that useful since there are multiple states I > might be in with and without the clock running and I wouldnt want stopping the > clock to reset the state. How about this? --8<---------------cut here---------------start------------->8--- (add-hook 'org-after-todo-state-change-hook '(lambda () ;; clock out when switching to WAIT ;; based on Eric Fraga's recent post to org-mode list (if (string= state "WAIT") (org-clock-out t)))) --8<---------------cut here---------------end--------------->8--- Not sure if this is exactly what you need but guess it's a starting point.. -- Manish