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

From: Knut Anders Hatlen <[email-masked]>
Date: Fri, 30 Dec 2022 12:04:48 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Knut Anders Hatlen <[email-masked]>
>> Date: Thu, 29 Dec 2022 22:25:09 +0100
>> 
>> 1. Evaluate: (setopt completions-header-format nil completion-show-help nil)
>> 
>> 2. Type M-x followed by TAB. The *Completions* buffer pops up and shows
>> all available commands.
>> 
>> 3. Type M-<down>.
>> 
>> Expected result: The first candidate in *Completions* is selected.
>> 
>> Actual result: The second candidate in *Completions* is selected.
>
> M-<DOWN> runs the command minibuffer-next-completion, so I'm unsure
> why you expect what you expect.  It looks like Emacs behaves as
> documented here.

If I don't touch the completions-header-format and completion-show-help
options, M-<down> selects the first candidate first, not the second
candidate. I find that behaviour reasonable. I didn't expect that
setting those two options would have any impact on which candidate
minibuffer-next-completion selected first. I expected that it only
affected whether or not the header and the help text was printed in the
*Completions* buffer, and that the navigation worked as before.

To select the first candidate when those two options are nil, I have to
do M-<down> followed by M-<up>. My expectation was that it should be
fewer (or at least not more) keystrokes to select the first candidate
than the second candidate.

-- 
Knut Anders