Reputation: 605
The documentation of org-agenda-sorting-strategy is quite vague when describing the two following sorting strategy. It specifies only how the tags are ordered between done and not done, but does not say anything about how the tags are ordered inside both classes:
todo-state-up Sort by todo state, tasks that are done last.
todo-state-down Sort by todo state, tasks that are done first.
If I list all tasks using a simple agenda command as the following
("z" "TEST" tags-todo ""
(
(org-agenda-sorting-strategy '(todo-state-up)) ;; Sort by todo state, tasks that are done last.
)
)
the (todo) tasks are displayed in the order MAYB TODO NEXT ACTF PAUS WAIT, which does not correspond either to the alphabetical order, neither to the order in my org-todo-keywords:
(sequence "ACTF(a!)" "PAUS(p@)" "WAIT(w@)" "NEXT(n!)" "MAYB(m!)" "TODO(t!)"
"|"
"DONE(d@)" "CANC(c@)"
)
(sequence "KNOW(k@/!)" )
I will get around and program my own org-agenda-cmp-user-defined function to order according to the position of the todo-keyword in org-todo-keywords, but I am surprised that todo-state-up does not already corresponds to this (and I am not feel proficient enough in LISP to dive in the code of org-mode yet).
(I am using Org-mode version 7.7 (release_7.7.615.g02c26.dirty) on GNU Emacs 23.3.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-04-01)
Upvotes: 0
Views: 962
Reputation: 953
I ran into this exact same confusion, and restarting still didn't fix the problem. What I realized eventually was that I had TODO cycling order further customized using #+SEQ_TODO:
, which was overriding the order of my global org-todo-keywords
variable.
Upvotes: 0
Reputation: 605
Actually, after restarting org-mode with the new value of org-todo-keywords, it turns out that todo-state-up does use the order of org-todo-keywords.
So I have my display of tasks ordered by todo-keywords now, which really simplifies the writing of agenda shortcuts, and tremendously speed-up their execution (one single instruction as opposed to one per keyword).
Yay!
Upvotes: 2