GNU bug report logs -
#60505
29.0.60; Fido Mode and Tramp Completion
Previous Next
Reported by: Julien Roy <julien <at> jroy.ca>
Date: Tue, 3 Jan 2023 00:22:02 UTC
Severity: normal
Merged with 51386,
52758,
53513,
54042
Found in versions 28.0.50, 29.0.50, 29.0.60
Fixed in version 29.2
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> I could imagine that the completion machinery offers an API that a
> package could register its own idea of a file name syntax.
The completion code relies on `file-name-directory`,
`directory-file-name`, etc... for that.
The problem as I see it goes as follows:
According to `file-name-directory`, in `/ssh:myhost` the part
`ssh:myhost` is an element of the `/` directory. For this reason, the
completion machinery would expect (file-name-all-completions "s" "/") to
include "ssh:myhost" in its return list rather than only "ssh:".
Now, it's impractical for Tramp to do that. So the end result is the
kind of bug reports we're discussing.
One way to fix the problem is for Tramp to "teach" the rest of the
system that `/ssh:` is a kind of directory, in which case the completion
machinery would know that (file-name-all-completions "s" "/") returns
"ssh:" and that "myhost" would be included only in the return value of
(file-name-all-completions "" "/ssh:").
Another is to change Tramp's syntax so that it uses the regular "/"
separator rather than ":". This would get a similar result but without
touching `file-name-directory` and friends.
We could also consider introducing a new set of (file-name) functions
completion-file-name-directory, completion-directory-file-name, ...
so the completion code can use its own notion of how a file name gets
separated into parts. But introducing such a subtle distinction would
likely introduce a lot of bugs&confusion as well.
Stefan
This bug report was last modified 2 years and 148 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.