2

Let's say that I am looking at my agenda view (C-c c a), where I usually mark items as DONE from there (by pressing 't' several times to run through all statuses). The thing is, the fist status is TODO and the last DONE. But how to set a CANCELLED status, for those that have been cancelled without having to delete it or mark them as DONE (which is not true)? Thanks!

1

You can create a "CANCELED" state that is in a sequence by itself and that counts as DONE.

(setq org-todo-keywords
      '(
        (sequence "TODO(t)" "NEXT(n)" "STARTED(s)" "|" "DONE(d)")
        (sequence "|" "CANCELED(c)")
        ))

This gives you, essentially, two independent DONE states, neither of which will appear in the agenda todo lists.

  • Thanks. One question though: what do you mean "neither of which will appear in the agenda todo lists? Will the CANCELLED state behave exactly as DONE? – Emmanuel Goldstein Sep 8 '18 at 4:04
  • @EmmanuelGoldstein Yes. Any element of a org-todo-keywords sequence coming after a "|" is consider a "DONE" state, exactly like the default "DONE",for things like org-agenda-skip-timestamp-if-done. Changing the state to "CANCELED" will also trigger a closed timestamp to be added, if you have that configured. – erikstokes Sep 8 '18 at 16:11
  • Thanks, @erikstokes. One question: why the second sequence line? Why not just "|" "DONE" "CANCELLED" in one line after DONE? I just implemented your code in my .emacs file but couldn't see how to jump to CANCELLED. It only cycles through the first sequence. Thanks! – Emmanuel Goldstein Sep 9 '18 at 17:27
  • "CANCELLED" is in it's own sequence exactly so you can't cycle to it. I don't think of it as the "next" state from "DONE" but rather a completely different thing unrelated to any other sequence. You can switch to it with org-todo (C-c C-t). If you prefer you can put it in the same sequence as "DONE". It's purely a preference thing. – erikstokes Sep 9 '18 at 21:36
  • Thanks. This is cofusing: org-todo (C-c C-t) or SHIFT+right is what I use to cycle... so I still can't access the CANCEL state. There must be a way to jump to the other sequence. – Emmanuel Goldstein Sep 11 '18 at 3:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.