4

How can I randomize headers in org mode?

e.g. If I had a list like this, :

* apple
  1
* lemon
  2
* banana
* orange

How can I randomize those headers and get lists like these?:

* lemon
  2
* apple
  1
* orange
* banana

or

* orange
* lemon
  2
* banana
* apple
  1

(I'm planning to randomize a much longer list.)

3

I found the answer here. All I had to do was creating a function and call it once I got into org-sort f(function).

  • Using random as a sorting predicate is a wrong algorithm. – Juancho Apr 17 '16 at 19:19
  • 2
    To better help others, please post some code for your solution. The link is fine, but you could help a reader here a bit more. – Drew Apr 17 '16 at 20:54
  • I get the following message:"Function for comparing keys (empty for default sort-subr predicate) and a list of option. Just pressing enter is not working. – falematte Jul 28 '17 at 16:16
  • When I call org-sort Emacs ask me two functions respectively for extracting and comparing. Which one do I have to choose? – falematte Aug 11 '17 at 14:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.