From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Capture - stay clocked in? Date: Mon, 28 Feb 2011 17:40:23 -0500 Message-ID: <87fwr7okar.fsf@norang.ca> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=49132 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuBlV-0000TG-7j for emacs-orgmode@gnu.org; Mon, 28 Feb 2011 17:40:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuBlT-0007V1-IU for emacs-orgmode@gnu.org; Mon, 28 Feb 2011 17:40:29 -0500 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:40428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuBlT-0007Ue-Dg for emacs-orgmode@gnu.org; Mon, 28 Feb 2011 17:40:27 -0500 In-Reply-To: (Nathan Neff's message of "Mon, 28 Feb 2011 13:30:44 -0600") 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: Nathan Neff Cc: emacs-orgmode Nathan Neff writes: > Is there an option NOT to clock out of a Todo item that's > created using org-capture? > > I would like to use capture templates to define a new TODO task, and > just stay clocked in to the new TODO. I don't think there is an out-of-the-box way to do this today. You can add a hook to org-clock-out-hook that checks if you are completing a capture and clock that task in again. This might work okay if you always want to do that. My solution to this problem is just to clock in the interrupted task again with F9-SPC. Capture clocks in the capture task and clocks out when it is filed, and the following function switches the clock back to the last (captured) task. --8<---------------cut here---------------start------------->8--- (global-set-key (kbd " SPC") 'bh/clock-in-last-task) (defun bh/clock-in-last-task () "Clock in the interrupted task if there is one Skip the default task and get the next one" (interactive) (let ((clock-in-to-task (if (org-clock-is-active) (if (equal org-clock-default-task (cadr org-clock-history)) (caddr org-clock-history) (cadr org-clock-history)) (if (equal org-clock-default-task (car org-clock-history)) (cadr org-clock-history) (car org-clock-history))))) (org-with-point-at clock-in-to-task (org-clock-in nil)))) --8<---------------cut here---------------end--------------->8--- Regards, Bernt