From: Stephen Berman <stephen.berman@gmx.net>
To: Carlos Pita <carlosjosepita@gmail.com>
Cc: 51650@debbugs.gnu.org
Subject: bug#51650: Autocomplete: first Tab should show *Completions* buffer
Date: Sun, 07 Nov 2021 23:33:22 +0100 [thread overview]
Message-ID: <8735o77g0d.fsf@gmx.net> (raw)
In-Reply-To: <CAELgYhcWWa5zS0CDB5x0VeCcGvLxBF+jXCTTpkgiddw5Z6GfGA@mail.gmail.com> (Carlos Pita's message of "Sun, 7 Nov 2021 18:24:56 -0300")
On Sun, 7 Nov 2021 18:24:56 -0300 Carlos Pita <carlosjosepita@gmail.com> wrote:
> On Sun, Nov 7, 2021 at 5:39 PM Eli Zaretskii <eliz@gnu.org> wrote:
>>
>
>> > - 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.
>> [...]
>> 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.
>
> If we add the context that we're doing directory completion from the
> cwd my statement is true. If we remove that context I start to see
> where you're coming from. Let's say the algorithm is more generic and
> unaware of some facts like its initial value being valid. From its
> perspective it may start with an invalid response that's not even a
> prefix of a valid response. After the TAB that goes from ~/Desk to
> ~/Desktop/ at least it knows that the response is the prefix of some
> set of valid completions. So you may explain its behavior as:
>
> 1. C-x C-f => ~/ but from what I know this may be rubbish
> 2. TAB => ~/ ok this is a completion but there are more with the same prefix
> 3. TAB => ~/ as I said there are more with the same prefix, take a
> look at the other ones
> 4. Desk<TAB> => ~/Desktop/ ok this is a completion
> 5. TAB => ~/Desktop/ there are more with the same prefix, take a look
> at the other ones
>
> At this level of explanation, there is a difference between the TAB in
> 2 and the TAB in 5. I also get why you may be willing to say that from
> 1 to 2 a completion indeed happened when, on the face of it, this
> seems a nonsensical statement: the algorithm inspected a completion
> set at this point and realized that the initial value is a member of
> it. It's hardly what the manual conveys to a user unaware of the
> implementation, but I get it. I still don't get why 2 and 3 can't be
> merged into a single step but that would be a discussion about
> convenience, at least I'm satisfied with this logical tackle on the
> inconsistency issue.
In fact, 2 and 3 essentially do get merged by setting
insert-default-directory to nil: then `C-x C-f' displays no directory in
the prompt, and the first TAB pops up the *Completions* buffer
containing completions in the default directory (unless it's empty or
contains only one file). This seems to refute the contention that the
crucial difference between 2 and 5 is that in the former the user didn't
type anything.
Steve Berman
next prev parent reply other threads:[~2021-11-07 22:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-07 4:27 bug#51650: Autocomplete: first Tab should show *Completions* buffer Carlos Pita
2021-11-07 5:09 ` Carlos Pita
2021-11-07 7:29 ` Eli Zaretskii
2021-11-07 8:16 ` Carlos Pita
2021-11-07 8:24 ` Eli Zaretskii
2021-11-07 8:39 ` Carlos Pita
2021-11-07 10:28 ` Eli Zaretskii
2021-11-07 18:40 ` Carlos Pita
2021-11-07 19:00 ` Eli Zaretskii
2021-11-07 19:34 ` Carlos Pita
2021-11-07 19:55 ` Eli Zaretskii
2021-11-07 20:27 ` Carlos Pita
2021-11-07 20:38 ` Eli Zaretskii
2021-11-07 21:21 ` Lars Ingebrigtsen
2021-11-07 21:24 ` Carlos Pita
2021-11-07 22:33 ` Stephen Berman [this message]
2021-11-07 7:28 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735o77g0d.fsf@gmx.net \
--to=stephen.berman@gmx.net \
--cc=51650@debbugs.gnu.org \
--cc=carlosjosepita@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).