Carsten Dominik <carsten.dominik <at> gmail.com> writes: > Playing with this idea I noticed that the sorting function > did not accept their additional arguments like sorting-key > and get key-function in they way they should. So I patched > them, to make the following work in the current master: > > (defun org-sort-list-by-checkbox-type () > "Sort list items according to Checkbox state." > (interactive) > (org-sort-list > nil ?f > (lambda () > (if (looking-at org-list-full-item-re) > (cdr (assoc (match-string 3) > '(("[X]" . 1) ("[-]" . 2) ("[ ]" . 3) (nil . 4)))) > 4))))
I finally had a chance to play with this -- works nicely, except I managed to get emacs into an infinite loop this way: 1. C-c ^ f org-sort-list-by-checkbox-type 2. This puts the done items at the top, which I didn't want, so... C-c ^ F org- sort-list-by-checkbox-type. 3. Emacs goes into a tailspin (recovered by C-g). > I would think that > > checked - transitionary - unchecked - no box > > is a pretty decent default. I disagree. I'd suggest unchecked - transitionary - checked - no box. It makes more sense to pull the not-done items to the top, no? But it's easy to modify the function for my environment. Thanks!! hjh