[Top][All Lists]

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

Warnings from changes in tramp-make-tramp-file-name

From: Clément Pit-Claudel
Subject: Warnings from changes in tramp-make-tramp-file-name
Date: Thu, 31 Aug 2017 22:35:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Hi tramp-devel,

I hope this is the right place to write about this.
I've just noticed a change in Tramp from May 2017 that's causing warnings in 
some of my packages and in other packages installed on my machine (cider, 
with-editor, fsharp-mode):

  commit dca22e86e02d16a31128c163925b13404f777c0f
  Author: Michael Albinus <address@hidden>
  Date:   Wed May 24 16:16:53 2017 +0200

      Introduce a defstruct `tramp-file-name' as central data structure.

This commit changed the signature of tramp-make-tramp-filename thus:

  -(defun tramp-make-tramp-file-name (method user host localname &optional hop)
  +(defun tramp-make-tramp-file-name
  +    (method user domain host port localname &optional hop)

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?

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))

Was this API change intentional? A quick look at the code doesn't suggest that 
the warning is safe to ignore, so is there a better way to achieve the above 
that works in old and new tramp versions?


reply via email to

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