org-sort-list

org-sort-list is an interactive compiled Lisp function in `org-list.el'.


(org-sort-list &optional WITH-CASE SORTING-TYPE GETKEY-FUNC COMPARE-FUNC)

Sort list items.
The cursor may be at any item of the list that should be sorted.
Sublists are not sorted. Checkboxes, if any, are ignored.

Sorting can be alphabetically, numerically, by date/time as given
by a time stamp, by a property or by priority.

Comparing entries ignores case by default. However, with an
optional argument WITH-CASE, the sorting considers case as well.

The command prompts for the sorting type unless it has been given
to the function through the SORTING-TYPE argument, which needs to
be a character, (?n ?N ?a ?A ?t ?T ?f ?F ?x ?X). Here is the
detailed meaning of each character:

n Numerically, by converting the beginning of the item to a number.
a Alphabetically. Only the first line of item is checked.
t By date/time, either the first active time stamp in the entry, if
any, or by the first inactive one. In a timer list, sort the timers.
x By "checked" status of a check list.

Capital letters will reverse the sort order.

If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies
a function to be called with point at the beginning of the
record. It must return either a string or a number that should
serve as the sorting key for that record. It will then use
COMPARE-FUNC to compare entries.

Sorting is done against the visible part of the headlines, it
ignores hidden links.