Q: Each sub-list within the main list contains one of five possible categories. How can I customize the sort in the following order:
CUSTOM SORT ORDER:
1. TASKS
2. EVENTS
3. UNDATED
4. CONTACTS
5. DONE
BEGIN WITH:
'((("id" . "005") ("folder" . "EVENTS") ("misc" . "apples") ("foo" . "1"))
(("id" . "123") ("folder" . "CONTACTS") ("misc" . "oranges") ("foo" . "3"))
(("id" . "975") ("folder" . "UNDATED") ("misc" . "figs") ("foo" . "7"))
(("id" . "456") ("folder" . "TASKS") ("misc" . "bananas") ("foo" . "5"))
(("id" . "871") ("folder" . "DONE") ("misc" . "pears") ("foo" . "2"))
(("id" . "045") ("folder" . "EVENTS") ("misc" . "plums") ("foo" . "8"))
(("id" . "172") ("folder" . "CONTACTS") ("misc" . "avocados") ("foo" . "4"))
(("id" . "843") ("folder" . "UNDATED") ("misc" . "nectarines") ("foo" . "6"))
(("id" . "523") ("folder" . "TASKS") ("misc" . "onions") ("foo" . "10"))
(("id" . "278") ("folder" . "DONE") ("misc" . "coconuts") ("foo" . "9")))
END-WITH: (a secondary sort, after sorting by 5 categories is not required in this example).
'((("id" . "523") ("folder" . "TASKS") ("misc" . "onions") ("foo" . "10"))
(("id" . "456") ("folder" . "TASKS") ("misc" . "bananas") ("foo" . "5"))
(("id" . "005") ("folder" . "EVENTS") ("misc" . "apples") ("foo" . "1"))
(("id" . "045") ("folder" . "EVENTS") ("misc" . "plums") ("foo" . "8"))
(("id" . "975") ("folder" . "UNDATED") ("misc" . "figs") ("foo" . "7"))
(("id" . "843") ("folder" . "UNDATED") ("misc" . "nectarines") ("foo" . "6"))
(("id" . "172") ("folder" . "CONTACTS") ("misc" . "avocados") ("foo" . "4"))
(("id" . "123") ("folder" . "CONTACTS") ("misc" . "oranges") ("foo" . "3"))
(("id" . "871") ("folder" . "DONE") ("misc" . "pears") ("foo" . "2"))
(("id" . "278") ("folder" . "DONE") ("misc" . "coconuts") ("foo" . "9")))