aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/minibuffer.el23
1 files changed, 14 insertions, 9 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 0e9b1c199a3..f900557296e 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3608,16 +3608,21 @@ that is non-nil."
3608 (> (or s1 0) (or s2 0)))))) 3608 (> (or s1 0) (or s2 0))))))
3609 (minibuffer-default 3609 (minibuffer-default
3610 ;; If we have an empty pattern and a non-nil default, we 3610 ;; If we have an empty pattern and a non-nil default, we
3611 ;; probably want to make sure that default is bubbled to 3611 ;; want to make sure that default is bubbled to the top
3612 ;; the top so that a "force-completion" operation will 3612 ;; so that a "force-completion" operation will select
3613 ;; select it. We want that to happen even if it doesn't 3613 ;; it. We want that to happen even if it doesn't match
3614 ;; match the completion perfectly. 3614 ;; the completion perfectly.
3615 (cl-loop 3615 (cl-loop
3616 for l on pre-sorted 3616 ;; JT@2019-12-23: FIXME: ideally, we want to use
3617 for comp = (cadr l) 3617 ;; flex-matching itself on the default itself, not
3618 when (string-prefix-p minibuffer-default comp) 3618 ;; `equal' or `string-prefix-p'.
3619 do (setf (cdr l) (cddr l)) 3619 for fn in '(equal string-prefix-p)
3620 and return (cons comp pre-sorted) 3620 thereis (cl-loop
3621 for l on pre-sorted
3622 for comp = (cadr l)
3623 when (funcall fn minibuffer-default comp)
3624 do (setf (cdr l) (cddr l))
3625 and return (cons comp pre-sorted))
3621 finally return pre-sorted)) 3626 finally return pre-sorted))
3622 (t 3627 (t
3623 pre-sorted)))))) 3628 pre-sorted))))))