bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19032: 24.4; icomplete cannot select matches with C-x b with no inpu


From: Stefan Monnier
Subject: bug#19032: 24.4; icomplete cannot select matches with C-x b with no input
Date: Thu, 13 Aug 2020 09:43:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> +(defvar completion-use-stored-completions-when-no-input nil)
>  (defvar completion-fail-discreetly nil
>    "If non-nil, stay quiet when there  is no match.")
> @@ -1510,8 +1511,15 @@ completion--complete-and-exit
>  COMPLETION-FUNCTION is called if the current buffer's content does not
>  appear to be a match."
>      (cond
> -     ;; Allow user to specify null string
> -   ((= beg end) (funcall exit-function))
> +     ;; Allow user to specify null string.  In the case that
> +     ;; `completion-use-stored-completions-when-no-input' is t, use
> +     ;; the car of `completion-all-sorted-completions' as the
> +     ;; candidate.
> +     ((= beg end)
> +      (when completion-use-stored-completions-when-no-input
> +        (completion--replace beg end (car 
> completion-all-sorted-completions)))
> +      (funcall exit-function))

Would it be cleaner to have the following instead?

      ;; Allow user to specify null string.  Obey 
`completion-content-when-empty`.
      ((= beg end)
       (when completion-content-when-empty
         (completion--replace beg end completion-content-when-empty))
       (funcall exit-function))

So icomplete would be in charge of setting that var to the `car` of
`completion-all-sorted-completions`.


        Stefan






reply via email to

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