Subject: bug#51650: Autocomplete: first Tab should show *Completions* buffer

From: Carlos Pita <[email-masked]>
Date: Sun, 7 Nov 2021 05:16:50 -0300

Hi Eli,

> This is a long-standing behavior, which is very convenient with file
> names.  It is documented in the node "Completion Exit" in the Emacs
> manual.

I had read that node before posting but I still fail to see how it is
related to my point, because the node is about pressing Return to exit
the completion, but in my example I don't want to exit anything and
I'm just repeatedly pressing Tab.

> That'd get in the way of selecting the "complete, but not unique"
> candidate.  It is also a distraction.

I'm likely misunderstanding something, but the behavior you object
here seems very similar to the one in step 5 of my example. In step 5
there is a Tab that fails to complete and _at the same time_ both the
"not unique" message and the completion candidates are shown. This Tab
was preceded by a completing Tab. The difference with the Tab in step
2 is that this one was the first one and so not preceded by any other
Tab. In both cases (step 2 and step 5) the Tab may have succeeded or
failed to complete by similar reasons, in my example both actually
failed, still their behaviors differ.

I can understand why things work the way they do by looking at the
implementation. But I can't put it into simple meaningful reasons. The
manual says that when Tab is unable to complete it displays a list of
possible completions, yet in step 2 this is not true. The
implementation checks that the last command and the current command
are the same before showing that list of completions, so it surely
won't happen in step 2 since it's the first and only Tab in the
sequence. In order to explain this, one seems forced to say that _at
least_ two Tabs in a row have to be pressed to show the *Completions*
buffer: one won't do it, exactly two won't always do it (both of them
may complete something), so there must be a sequence of at least two
Tabs and the last one must be unable to complete.

But why? Perhaps I'm misunderstanding the manual because of that note
you mentioned, but then again how is the exit behavior relevant to my
argument?

Thank in advance,
Carlos