bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60505: 29.0.60; Fido Mode and Tramp Completion


From: Gregory Heytings
Subject: bug#60505: 29.0.60; Fido Mode and Tramp Completion
Date: Wed, 01 Feb 2023 18:12:43 +0000


It's correct that the same problem is present in Emacs 28, but it is not in Emacs 27, so it's a regression. As I tried to explain in bug#50387, the problem is that once Tramp is loaded, Tramp methods are returned when completions are requested for a root directory ("/"). This problem is even worse since commit d5c6bf9625: prior to that commit only the 'scp' and 'scpx' methods were returned (in emacs -Q), now all methods are returned. And this confuses the flex and substring completion mechanisms.

Yes. But this is not a Tramp fault.


It definitely is Tramp's "fault".


Completion styles like flex (and substring, didn't test) do ignore Tramp file name syntax. They simply think in terms of file name parts, separated by "/". This is not appropriate for remote file names.


What filenames are is defined for example by POSIX in its Definitions chapter ("Filename", "Pathname", "Pathname Resolution"). It is quite clear in those definitions that there is no place for a _method_ or a _host name_ in file names. Something with a method, a host name and a path is a different beast: it's an URI. And it's not a coincidence if (absolute) file names start with a slash, and URI do _not_ start with a slash.

Tramp decided, for a reason I do not clearly understand, to invent URIs starting with a slash. File name completion mechanisms rightly assume that file names correspond to the standard syntax of file names, and there is no reason (and, for that matter, no reliable way) to fix the current problem at the level of completion styles.

So I have yet another proposal: add a variable to let users (and modes) decide whether Tramp methods should be returned when completions for the root directory are requested. Patch attached.

Attachment: Improve-handling-of-Tramp-methods-by-completion-styl.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]