From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: stop clocking in from changing todo state for a subtree Date: Thu, 06 Dec 2012 06:45:17 -0500 Message-ID: <87obi7l7zm.fsf@norang.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgZtR-00046v-LE for emacs-orgmode@gnu.org; Thu, 06 Dec 2012 06:45:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgZtQ-00076S-2V for emacs-orgmode@gnu.org; Thu, 06 Dec 2012 06:45:29 -0500 Received: from mho-03-ewr.mailhop.org ([204.13.248.66]:51623 helo=mho-01-ewr.mailhop.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgZtP-000742-VY for emacs-orgmode@gnu.org; Thu, 06 Dec 2012 06:45:28 -0500 In-Reply-To: (Rainer Stengele's message of "Thu, 06 Dec 2012 09:13:43 +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: Rainer Stengele Cc: emacs-orgmode@gnu.org Hi Rainer, Rainer Stengele writes: > Clocking in changes my TODO state from TODO to INWORK, which is ok. > > I have some tasks which I want to stay with the initial TODO state when > clocking time to it. > Can I configure this behavior through a property inhibiting the state > change when clocking? Sure you can with an appropriate hook function. This is what I use to prevent clock in to NEXT when it is a capture task or a project/subproject (ie. any task with subtasks) You can modify it to use a property instead to achieve what you want. The helper functions (bh/is-task-p, bh/is-project-p) are available at http://doc.norang.ca/org-mode.html Regards, Bernt --8<---------------cut here---------------start------------->8--- ;; Change tasks to NEXT when clocking in (setq org-clock-in-switch-to-state 'bh/clock-in-to-next) (defun bh/clock-in-to-next (kw) "Switch a task from TODO to NEXT when clocking in. Skips capture tasks, projects, and subprojects. Switch projects and subprojects from NEXT back to TODO" (when (not (and (boundp 'org-capture-mode) org-capture-mode)) (cond ((and (member (org-get-todo-state) (list "TODO")) (bh/is-task-p)) "NEXT") ((and (member (org-get-todo-state) (list "NEXT")) (bh/is-project-p)) "TODO")))) --8<---------------cut here---------------end--------------->8---