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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 07 Nov 2021 22:38:56 +0200

> From: Carlos Pita <[email-masked]>
> Date: Sun, 7 Nov 2021 17:27:58 -0300
> Cc: [email-masked]
> 
> > But the difference is that until the first TAB the user cannot know
> > whether there is any completion.  Only after Emacs doesn't complete is
> > that fact known.
> 
> First of all, I'm assuming:
> 
> - The initial value is taken from the current working directory so
> it's always a valid completion.

The completion doesn't know that.  It's just what the caller arranged
for it to display.

> - TAB never completes across the directory boundary.

But it can complete less than that.

> You seem to be saying that the TAB that produced ~/Desktop/ from
> ~/Desk is adding some worthy information about the contents of
> ~/Desktop, and therefore about possible completions, that
> wouldn't be there if the user, say, launched emacs from ~/Desktop
> as in #3. But, for the life of me, I cannot see it :(

The completion doesn't know where it was launched from.  It just knows
what the user typed, and in the "~/" case the user didn't type
anything.