@@ -442,36 +442,37 @@ Usually run by inclusion in `minibuffer-setup-hook'."
442
442
(add-hook 'post-command-hook 'icomplete-post-command-hook nil t )))
443
443
444
444
(defun icomplete--sorted-completions ()
445
- (cl-loop
446
- with beg = (icomplete--field-beg )
447
- with end = (icomplete--field-end )
448
- with all = (completion-all-sorted-completions beg end)
449
- for fn in (cond ((and minibuffer-default
450
- (= (icomplete--field-end ) (icomplete--field-beg )))
451
- ; ; When we have a non-nil default and no input
452
- ; ; whatsoever: we want to make sure that default
453
- ; ; is bubbled to the top so that
454
- ; ; `icomplete-force-complete-and-exit' will
455
- ; ; select it (do that even if the match doesn't
456
- ; ; match the completion perfectly.
457
- `(,(lambda (comp )
458
- (equal minibuffer-default comp))
459
- ,(lambda (comp )
460
- (string-prefix-p minibuffer-default comp))))
461
- ((and fido-mode
462
- (not minibuffer-default)
463
- (eq (icomplete--category) 'file ))
464
- `(,(lambda (comp )
465
- (string= " ./" comp)))))
466
- thereis (cl-loop
467
- for l on all
468
- while (consp (cdr l))
469
- for comp = (cadr l)
470
- when (funcall fn comp)
471
- do (setf (cdr l) (cddr l))
472
- and return
473
- (completion--cache-all-sorted-completions beg end (cons comp all)))
474
- finally return all))
445
+ (or completion-all-sorted-completions
446
+ (cl-loop
447
+ with beg = (icomplete--field-beg )
448
+ with end = (icomplete--field-end )
449
+ with all = (completion-all-sorted-completions beg end)
450
+ for fn in (cond ((and minibuffer-default
451
+ (= (icomplete--field-end ) (icomplete--field-beg )))
452
+ ; ; When we have a non-nil default and no input
453
+ ; ; whatsoever: we want to make sure that default
454
+ ; ; is bubbled to the top so that
455
+ ; ; `icomplete-force-complete-and-exit' will
456
+ ; ; select it (do that even if the match doesn't
457
+ ; ; match the completion perfectly.
458
+ `(,(lambda (comp )
459
+ (equal minibuffer-default comp))
460
+ ,(lambda (comp )
461
+ (string-prefix-p minibuffer-default comp))))
462
+ ((and fido-mode
463
+ (not minibuffer-default)
464
+ (eq (icomplete--category) 'file ))
465
+ `(,(lambda (comp )
466
+ (string= " ./" comp)))))
467
+ thereis (cl-loop
468
+ for l on all
469
+ while (consp (cdr l))
470
+ for comp = (cadr l)
471
+ when (funcall fn comp)
472
+ do (setf (cdr l) (cddr l))
473
+ and return
474
+ (completion--cache-all-sorted-completions beg end (cons comp all)))
475
+ finally return all)))
475
476
476
477
477
478
0 commit comments