emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 72e0ef74d0: * lisp/icomplete.el: Consider a list in minibuffer-de


From: Juri Linkov
Subject: master 72e0ef74d0: * lisp/icomplete.el: Consider a list in minibuffer-default (bug#55800)
Date: Sun, 12 Jun 2022 14:24:27 -0400 (EDT)

branch: master
commit 72e0ef74d0ed242cd75226aef887d87391c23f6d
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * 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.
---
 lisp/icomplete.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 8802e7565f..be7f6831cc 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]