Clément Pit-Claudel <[email protected]> writes:

> Hi tramp-devel,

Hi Clément,

> Is there a way to write code compatible with both the old and the new
> Tramp? Was that method just an internal function, not to be used by
> packages?

Yes. Yes.

> Here's a concrete use case from one of my packages, which used
> tramp-make-tramp-file-name to convert a local path (local-fname) into
> a remote one on the same host as the current buffer.  I use this to
> look for a binary on the remote machine (e.g. the user customizes that
> path variable to /bin/z3, and I use the code below to convert that
> into /ssh:user@host:/bin/z3):
>
>       (with-parsed-tramp-file-name buffer-file-name nil
>          (tramp-make-tramp-file-name method user host local-fname))

(concat (file-remote-p buffer-file-name) local-fname)

See als the docstring of file-remote-p, which recommends this style.

> Thanks!
> Clément.

Best regards, Michael.

_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to