org.el (org-sort-entries): Improve TODO entries sorting

* org.el (org-sort-entries): When sorting by TODO keywords,
put TODO entries first, then entries without a TODO keyword,
then DONE entries.

Thanks to Eric Abrahamsen for triggering this.
This commit is contained in:
Bastien Guerry 2014-05-26 07:10:16 +02:00
parent abe931dca9
commit 2affa4d333
1 changed files with 3 additions and 2 deletions

View File

@ -8904,8 +8904,9 @@ When sorting is done, call `org-after-sorting-entries-or-items-hook'."
(or (org-entry-get nil property) ""))
((= dcst ?o)
(if (looking-at org-complex-heading-regexp)
(- 9999 (length (member (match-string 2)
org-todo-keywords-1)))))
(let* ((m (match-string 2))
(s (if (member m org-done-keywords) '- '+)))
(- 99 (funcall s (length (member m org-todo-keywords-1)))))))
((= dcst ?f)
(if getkey-func
(progn