(substring c base-size)))
hist)))))
+(defun minibuffer-sort-by-length (completions)
+ "Sort COMPLETIONS by length."
+ (sort completions (lambda (a b) (< (length a) (length b)))))
+
(defun minibuffer-sort-alphabetically (completions)
"Sort COMPLETIONS alphabetically.
(defcustom minibuffer-completions-sort-orders
'((?a "alphabetical" "Sort alphabetically"
- minibuffer-sort-alphabetically "sorted alphabetically")
+ minibuffer-sort-alphabetically "alphabetically")
(?h "historical" "Sort by position in minibuffer history"
- minibuffer-sort-by-history "sorted by position in minibuffer history")
+ minibuffer-sort-by-history "position in minibuffer history")
(?i "identity" "Disable sorting" identity nil)
- (?d "default" "Default sort order" nil nil))
+ (?d "default" "Default sort order" nil nil)
+ (?l "length" "Sort by length" minibuffer-sort-by-length "length"))
"List of minibuffer completions sort orders.
Each element is a list of the form (CHAR NAME HELP FUNC DESC),
where CHAR is a character that you type to select this sort order