Subject: bug#60411: 29.0.60; minibuffer-next-completion skips first candidate when completions-header-format and completion-show-help are nil

From: Stefan Monnier <[email-masked]>
Date: Sun, 01 Jan 2023 12:00:25 -0500

> @@ -2275,8 +2275,14 @@ display-completion-list
>  
>      (with-current-buffer standard-output
>        (goto-char (point-max))
> -      (when completions-header-format
> +      (when (stringp completions-header-format)
>          (insert (format completions-header-format (length completions))))
> +      (when (or (not (stringp completions-header-format))
> +                (string= completions-header-format ""))
> +        ;; Insert an invisible line, otherwise the first call to
> +        ;; 'minibuffer-next-completion' might select the second
> +        ;; completion candidate.  See bug#60411.
> +        (insert (propertize "\n" 'invisible t)))
>        (completion--insert-strings completions group-fun)))
>  
>    (run-hooks 'completion-setup-hook)

Yuck.  I get the impression that it would be cleaner to fix "the first
call to `minibuffer-next-completion`" instead.

        Stefan