 
  e.g. 10 sec / 1 min"
   :group 'boop
-  :type 'string)
-
-(defcustom boop-sort-func nil
+  :type 'integer)
+
+(defvar boop-sort-func nil
   "Comparator function used to sort `boop-result-alist` when being formatted.
 
 When non-nil, `boop-sort-func` should be a comparator funciton
 which takes two arguments, When set to nil, no sorting is
 applied.")
 
-(defvar boop--format-func 'boop--format-result "The function to use to format results.")
 (defvar boop--shorten-id-func 'boop--shorten-substring "The function used to shorten an ID string.")
+(defvar boop--format-result-func 'boop--format-result "The function to use to format an individual result.")
+(defvar boop--format-results-func 'boop--format-results-sorted
+  "The function to use to format `boop-result-alist`.  This
+function should take a function as an argument which can format a
+single result.")
+
 ;;;; Functions
 
 (defun boop--get-plugin-scripts ()

  "The default directory to read plugins from.")

(defvar boop-config-alist nil
  "An alist of scripts and the arguments to run them with.

Each entry Should be in the format (ID SCRIPT_NAME &optional ARGS)")

(defvar boop-result-alist nil
  "This is an alist to track the results of plugins and boops.

;; Formatting and Renderings the results

(defun boop-format-results ()
  "Apply the two customised format functions to create a propertized display string."
  (funcall boop--format-results-func boop--format-result-func))

;;;;;; multiple results

(defun boop--format-results-sorted (f)
  "Format `boop-result-alist` into a propertized display string."
  (let ((sorted-result-alist
         (if boop-sort-func (--sort (funcall boop-sort-func (cdr it) (cdr other)) boop-result-alist)
           boop-result-alist)))
    (mapconcat f sorted-result-alist "")))

(defun boop--format-results-grouped-by-result (f)
  "Format `boop-result-alist` into a propertized display string."
  (let ((results (-group-by 'cdr boop-result-alist)))
    (mapconcat (lambda (it) (format "[ %s]" (mapconcat f (cdr it) ""))) results " ")))

;;;;;; individual results

(defun boop--format-result-as-id (result)
  "Format an individual RESULT using its ID."
