Subject: bug#31357: 26.1; tramp-make-tramp-file-name: incompatible lisp changes in 26.1 ?

From: Michael Albinus <[email-masked]>
Date: Fri, 04 May 2018 09:44:56 +0200

Phil Sainty <[email-masked]> writes:

Hi Phil,

>> `tramp-make-tramp-file-name' has never been documented as public
>> function, it is intended for internal use. Granted, this should have
>> been signalled better.
>
> Given the function naming, a NEWS entry seems warranted to me.

Well, this is a historical accident. None of the Tramp functions has
been indicated as internal (as a double slash in the function name would
do). This was already the case when I've entered the Tramp team back in
2002. And later on I resisted to perform a big renaming just for this.

> I do think that there *should* be a public interface for manipulating
> tramp file names.  If these were never intended as such then perhaps
> such functionality could be introduced...

Perhaps. These days, people dissect a remote file name by the different
calls of `file-remote-p', and reconstruct the file name by `concat' or
`format'. An public interface might help. But this won't be
`tramp-make-tramp-file-name', because this is the internal working
horse, which will always be adapted to whatever need arrives in Tramp.

Maybe you could propose such a public interface? It shouldn't be Tramp
specific, other file name handlers shall profit from this as well. And
local file names as arguments shall also be possible, so that you could
change a local file name into a remote file name by a simple call (think
about the common case changing a local file name into a sudo'ed one).

See also function `file-local-name' (introduced in Emacs 26.1), which
could be part of such broader interface.

>> (setf (tramp-file-name-host vec) "whatever")
>
> Ah, I'd actually tried that in 25.2 but those are not generalized
> variables in that version.  I see that it works in 26.1 though,
> so that's an excellent enhancement.

Well, `tramp-file-name' has been introduced as defstruct in Tramp
2.3. Before, there was no dedicated type, and VEC was always a, hmm,
simple vector.

> cheers,
> -Phil

Best regards, Michael.