Subject: bug#60505: 29.0.60; Fido Mode and Tramp Completion

From: Stefan Monnier <[email-masked]>
Date: Thu, 02 Feb 2023 10:05:25 -0500

> I don't deny that there is a problem, and it isn't a surprise that
> people report about. But I don't think that Tramp misbehaves, it does
> exactly what it is specified to do.
>
> I guess that flex and friends use completion out of the
> specification.

It's neither's fault, really.  It's a shortcoming of the intermediary,
i.e. the completion-table API.

The completion-table API only offers "prefix" completion, so the only
thing "flex" and "substring" can do when asked to complete `/ssh:`
is to ask for all the completions in `/` (because the definition of
"substring" completion means that it should also match `/foossh:bar`
and similarly for "flex").

I have some draft of a new completion-table API where it's possible for
the completion style to propagate more information about which
completions it's looking for, so for example the completion-table might
be asked to return the completions that match `/*ssh:*` or even
`/*s*s*h*:*`.  It's then up to the completion-table to do something
useful with it (of course, the API is designed such that the
completion-tables don't *have* to handle those more complex cases:
there's a general fallback mechanism which reduces those queries to
simpler ones).

        Stefan