diff options
| author | João Távora | 2020-01-09 10:01:16 +0000 |
|---|---|---|
| committer | João Távora | 2020-01-09 10:08:43 +0000 |
| commit | eb3c6ad325ea54acbea047508b5496d130bff93a (patch) | |
| tree | 567ab0ff785e5b91b4e9d156afce56be3ccba911 | |
| parent | 1fe596d89f9398f887bde7174bede39270065f9e (diff) | |
| download | emacs-eb3c6ad325ea54acbea047508b5496d130bff93a.tar.gz emacs-eb3c6ad325ea54acbea047508b5496d130bff93a.zip | |
Consider non-string minibuffer-default in icomplete
Fixes: bug#38992
* lisp/icomplete.el (icomplete--sorted-completions): Consider
non-string minibuffer-default.
| -rw-r--r-- | lisp/icomplete.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index e7e8cbf6e0a..ceff11f9bd6 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el | |||
| @@ -448,13 +448,14 @@ Usually run by inclusion in `minibuffer-setup-hook'." | |||
| 448 | with end = (icomplete--field-end) | 448 | with end = (icomplete--field-end) |
| 449 | with all = (completion-all-sorted-completions beg end) | 449 | with all = (completion-all-sorted-completions beg end) |
| 450 | for fn in (cond ((and minibuffer-default | 450 | for fn in (cond ((and minibuffer-default |
| 451 | (stringp minibuffer-default) ; bug#38992 | ||
| 451 | (= (icomplete--field-end) (icomplete--field-beg))) | 452 | (= (icomplete--field-end) (icomplete--field-beg))) |
| 452 | ;; When we have a non-nil default and no input | 453 | ;; When we have a non-nil string default and |
| 453 | ;; whatsoever: we want to make sure that default | 454 | ;; no input whatsoever: we want to make sure |
| 454 | ;; is bubbled to the top so that | 455 | ;; that default is bubbled to the top so that |
| 455 | ;; `icomplete-force-complete-and-exit' will | 456 | ;; `icomplete-force-complete-and-exit' will |
| 456 | ;; select it (do that even if the match doesn't | 457 | ;; select it (do that even if the match |
| 457 | ;; match the completion perfectly. | 458 | ;; doesn't match the completion perfectly. |
| 458 | `(,(lambda (comp) | 459 | `(,(lambda (comp) |
| 459 | (equal minibuffer-default comp)) | 460 | (equal minibuffer-default comp)) |
| 460 | ,(lambda (comp) | 461 | ,(lambda (comp) |