From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: help advicing org-todo Date: Thu, 03 Jan 2013 17:48:44 +0100 Message-ID: <87zk0q2owj.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqnyK-0007Ca-8T for emacs-orgmode@gnu.org; Thu, 03 Jan 2013 11:48:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TqnyI-0004fn-SH for emacs-orgmode@gnu.org; Thu, 03 Jan 2013 11:48:48 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:61732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqnyI-0004fb-N0 for emacs-orgmode@gnu.org; Thu, 03 Jan 2013 11:48:46 -0500 Received: by mail-wi0-f180.google.com with SMTP id hj13so8693288wib.13 for ; Thu, 03 Jan 2013 08:48:45 -0800 (PST) In-Reply-To: (Luca Ferrari's message of "Thu, 3 Jan 2013 17:02:18 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Luca Ferrari Cc: emacs-orgmode@gnu.org Hi Luca, Luca Ferrari writes: > I'd like to advice the function org-todo to check in and check out the > clock automatically. I would not advice `org-todo', I would explore the idea of adding a function to `org-after-todo-state-change-hook'. > I've defined the org-todo-keywords so that they have a choice letter as follows: > > (setq org-todo-keywords > '( (sequence "TODO(t!)" "|" "DONE(d!)") > (sequence "FEATURE(f!)" "BUG(b!)" "IMPLEMENTING(i!)" "|" > "COMPLETED(c!)") > )) > > and I'd like to start the clock each time the "i" (implementing) is > chosen, stopping the clock each time the "c" (completed) is selected. You can use (setq org-clock-out-when-done t) for this. > However I've a little problem doing the advice because the argument is > null and therefore I don't know which letter the user has pressed. > Anyone can provide a little help? HTH, -- Bastien