Commit 72e0ef74 authored by Juri Linkov's avatar Juri Linkov
Browse files

* lisp/icomplete.el: Consider a list in minibuffer-default (bug#55800)

* lisp/icomplete.el (icomplete--sorted-completions): Handle a string value
in the first element of the list of default values in minibuffer-default.
parent 2745fc70
Pipeline #18472 failed with stages
in 195 minutes and 49 seconds
......@@ -559,7 +559,8 @@ Usually run by inclusion in `minibuffer-setup-hook'."
;; predicates" which may vary depending on specific
;; `completing-read' invocations, described below:
for fn in (cond ((and minibuffer-default
(stringp minibuffer-default) ; bug#38992
(stringp (or (car-safe minibuffer-default)
minibuffer-default)) ; bug#38992 bug#55800
(equal (icomplete--field-string) icomplete--initial-input))
;; Here, we have a non-nil string default and
;; no input whatsoever. We want to make sure
......@@ -577,7 +578,9 @@ Usually run by inclusion in `minibuffer-setup-hook'."
;; Has "bar" at the top, so RET will select
;; it, as desired.
,(lambda (comp)
(equal minibuffer-default comp))
(equal (or (car-safe minibuffer-default)
minibuffer-default)
comp))
;; Why do we need this second predicate?
;; Because that'll make things like M-x man
;; RET RET, when invoked with point on the
......@@ -599,7 +602,9 @@ Usually run by inclusion in `minibuffer-setup-hook'."
;; useful for a very broad spectrum of
;; cases.
,(lambda (comp)
(string-prefix-p minibuffer-default comp))))
(string-prefix-p (or (car-safe minibuffer-default)
minibuffer-default)
comp))))
((and fido-mode
(not minibuffer-default)
(eq (icomplete--category) 'file))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment