random - Randomize TODO list? -
i have noticed when @ todo list, things done top half of portion since read top bottom, , time half way bottom, find todo done. wondering, there way mix todo list ordering randomized?
as mentioned org-sort
let's specify function sort by:
if sorting-type ?f or ?f, getkey-func specifies function called point @ beginning of record. must return either string or number should serve sorting key record.
as happens random
function returns random number. m-x org-sort f random
randomize sort order in org file.
however instead of changing file use org-agenda
view todos in randomized order. setting org-agenda-cmp-user-defined
can customize sort order. function take 2 arguments (the agenda entries compare) , should return -1,1 or 0 depending on of entries "smaller". here such function:
(defun org-random-cmp (a b) "return -1,0 or 1 randomly" (- (mod (random) 3) 1))
and here agenda view shows todo items in random order:
(add-to-list 'org-agenda-custom-commands '("r" "all todo items in random order" alltodo "" ((org-agenda-cmp-user-defined #'org-random-cmp))))
Comments
Post a Comment