[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [PATCH] Fix clocking on capture completion

From: Bernt Hansen
Subject: Re: [Orgmode] [PATCH] Fix clocking on capture completion
Date: Sat, 24 Jul 2010 14:45:58 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Viktor Rosenfeld <address@hidden> 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))
          (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]