I've made some progress and have published a gist with my current approach to 
multi-hop Docker container completion in TRAMP. I'd appreciate comments and 
suggestions, and whether this is a reasonable direction to take or if I'm 
missing something important.

  https://gist.github.com/genegoykhman/09868acd369b3fae866be6446997de9f

I've taken an approach similar to the one Kristofer describes ...

> A very simple change I tried when previously trying to get multihop
> completion working
> with another backend was that if I changed the variable
> `tramp-compat-temporary-file-directory'
> for the function `temporary-file-directory' in the completion
> functions (like `tramp-container--completion-function'), then at least

I'm advising :before tramp-completion-handle-file-name-all-completions and 
parsing out the required remote directory from which we need to call the docker 
program to get remote completions. Then, I'm adding a custom completion 
function my-tramp-container-completion-function that takes that directory (if 
it has been parsed) and sets it as the default-directory.

> Another issue that I found, which maybe is unavoidable, is that some
> of the completion functions in `tramp-container' requires that the
> container
> program is installed on the local host, but sometimes I only have

I /think/ the approach I've taken only requires that the container program be 
available on the remote host on which we are trying to get the completion list.

Feedback appreciated!


Reply via email to