[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warnings from changes in tramp-make-tramp-file-name
From: |
Michael Albinus |
Subject: |
Re: Warnings from changes in tramp-make-tramp-file-name |
Date: |
Fri, 01 Sep 2017 16:03:05 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Clément Pit-Claudel <address@hidden> 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:address@hidden:/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.