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

From: Michael Albinus <[email-masked]>
Date: Thu, 02 Feb 2023 09:25:41 +0100

Eli Zaretskii <[email-masked]> writes:

Hi Eli,

>> More importantly (as I unsuccessfully tried to convey) it circumvents the
>> bug in the implementation of a particular completion mechanism, which is
>> not the place where the bug lies and should be fixed.  It is not
>> reasonable to expect that all existing and future file completion
>> mechanisms should implement specific rules to deal with the Tramp syntax
>> (or, for that matter, with the syntax of any other package).
>
> From my POV, it is very reasonable to expect that completion
> mechanisms know about Tramp syntax and support it.  Tramp became long
> ago an integral part of the Emacs core, so its syntax is as important
> to support as any other syntactical aspects of file names in Emacs,
> such as the "/:" "quoting".

I could imagine that the completion machinery offers an API that a
package could register its own idea of a file name syntax. Plus a hook,
for parts of that file name the package is responsible itself. This
would avoid the need to check in the completion machinery, which Tramp
syntax is recent.

The current API, file name handlers for file-name-completion and
file-name-all-completions, is too restricted.

Other packages but Tramp would profit as well. For example, running
"emacs -Q", typing "/: TAB", removes the colon and offers completions
for "/". I don't know whether this is really right; there is a reason
that a user has started with "/:".

Best regards, Michael.