Org: Changing the task states

I find it useful to keep track of which tasks I’ve started. Adding the
following line to the start of my Org file adds STARTED to my to-do
status keywords.

#+SEQ_TODO: TODO(t) STARTED(s) WAITING(w) | DONE(d)

Here’s some code to make it easier to clock in and out of tasks:

(defun sacha/org-clock-in-if-starting ()
  "Clock in when the task is marked STARTED."
  (when (and (string= state "STARTED")
             (not (string= last-state state)))
    (org-clock-in)))
(add-hook 'org-after-todo-state-change-hook
	  'sacha/org-clock-in-if-starting)
(defadvice org-clock-in (after sacha activate)
  "Set this task's status to 'STARTED'."
  (org-todo "STARTED"))

On Technorati: ,

Random Emacs symbol: isearch-update-ring – Function: Add STRING to the beginning of the search ring.

  • http://[email protected] dericbytes

    Thanks for this code. I found it really helpful…. I wrote some code to start the clock from a remember template insertion when the TODO state is STARTED. I posted it on the org mailing list.

    http://thread.gmane.org/gmane.emacs.orgmode/12862/focus=12867