org-randomnote
org-randomnote copied to clipboard
Implement uniformly-random selection of headings
In order to implement this, store association lists of file names to the header count and to the modification tick. Every 30 seconds starting from the first time org-randomnote is called, the header count is updated, but only for buffers that have changed since the last timer. The probability that a given file is selected is weighted based on the number of headers it has, so that a file with twice as many headers as another file will be selected twice as often. The selection of headers within files was already uniformly random, so no change is needed there.
Fixes #7