From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: [PATCH] Fix clocking on capture completion Date: Sat, 24 Jul 2010 14:45:58 -0400 Message-ID: <878w50vhuh.fsf@gollum.intra.norang.ca> References: <1279981217-14625-1-git-send-email-bernt@norang.ca> <20100724184151.GA97728@stan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=33069 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcjjY-0000ek-3M for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 14:46:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcjjW-0001hF-Do for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 14:46:04 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:58517) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcjjW-0001h3-9e for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 14:46:02 -0400 In-Reply-To: <20100724184151.GA97728@stan> (Viktor Rosenfeld's message of "Sat, 24 Jul 2010 20:41:51 +0200") 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: Viktor Rosenfeld Cc: emacs-orgmode@gnu.org Viktor Rosenfeld writes: > this patch fixes the problem for me. I'm on > release_7.01g.24.g6b5cf.dirty Thanks for the feedback. > A somewhat related question: I use your bh/clock-in-to-next function to > change the todo state to STARTED when clocking in TODO tasks. > Unfortunately it is being applied to Capture buffers. I tried changing > the buffer-name to "CAPTURE-*" but that didn't help. I've updated the function for capture mode but not posted the changes to my doc.norang.ca yet. Here's the function that works for me with capture and remember mode. I'm going to be removing the remember mode logic since I no longer use that. (defun bh/clock-in-to-next (kw) "Switch task from TODO to NEXT when clocking in. Skips remember tasks and tasks with subtasks" (if (and (string-equal kw "TODO") (not (string-equal (buffer-name) "*Remember*")) (not (and (boundp 'org-capture-mode) org-capture-mode))) (let ((subtree-end (save-excursion (org-end-of-subtree t))) (has-subtask nil)) (save-excursion (forward-line 1) (while (and (not has-subtask) (< (point) subtree-end) (re-search-forward "^\*+ " subtree-end t)) (when (member (org-get-todo-state) org-not-done-keywords) (setq has-subtask t)))) (when (not has-subtask) "NEXT")))) HTH, Bernt