I defined 4 TODO keywords. Two are in the TODO state and two others (DONE and CNCL) belong to the DONE state:

(setq org-todo-keywords
      '((sequence "TODO" "WAIT" "|" "DONE" "CNCL" )))

I defined a sort strategy:

(setq org-agenda-sorting-strategy
      '((agenda habit-down time-up todo-state-down priority-down category-keep)
       (todo priority-down category-keep)
       (tags priority-down category-keep)
       (search category-keep)))

Strangely, todo-state-down puts tasks in the following order:

xxx: Scheduled: WAIT waiting for info
xxx: Scheduled: TODO still need to do
xxx: Scheduled: CNCL won't be doing this one
xxx: Scheduled: DONE put this at the bottom

I see that the TODO states are on top and the DONE states are on the bottom. But, within each state, the WAIT appears before TODO, and CNCL before DONE.

That is unexpected. I thought I'd get tasks in the order that I defined the todo-keywords: TODO, WAIT, DONE and finally CNCL.

Any suggestions?

  • There are more factors involved at sorting time, like category, scheduling, and the listing type. See orgmode.org/manual/… and C-h v org-agenda-sorting-strategy – Muihlinn Oct 4 at 20:32
  • Ok.... but for the example I’ve provided, those other things are the same for the tasks. Category = xxx. Priority = none. All scheduled for the same day. Etc. only difference is TODO state. – Raj Oct 4 at 22:06
  • I've put up this gist gist.github.com/muihlinn/afb50a9be56911b03f98db13369a1bd6 with your setup, it doesn't replicate your issue. Can you fork it and correct everything until it happens? – Muihlinn Oct 6 at 6:41
  • I used the code you provided. Interesting behavior. In the test block of agenda, I get the expected behavior: TODO, WAIT, DONE, CNCL in that order. However, in the regular block (that is generated by org-agenda-list to produce weekly view), I see the order: WAIT, TODO, CNCL, DONE. – Raj Oct 6 at 13:17

Your Answer

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

Browse other questions tagged or ask your own question.