[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] [PATCH] Fix clocking on capture completion
From: |
Viktor Rosenfeld |
Subject: |
Re: [Orgmode] [PATCH] Fix clocking on capture completion |
Date: |
Sun, 25 Jul 2010 00:09:26 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi Bernt,
thanks for the updated version. It works as expected.
Cheers,
Viktor
Bernt Hansen wrote:
> Viktor Rosenfeld <address@hidden> writes:
>
> > 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"))))