Multi-hop completion with TRAMP 2.5.4-pre/Emacs 28.3?

Tim Landscheidt <[email protected]>
Newsgroups gmane.emacs.tramp
Organization https://www.tim-landscheidt.de/
Message-ID <[email protected]>
Hi,

with TRAMP 2.5.4-pre/Emacs 28.3, if I define a completion
function, it does not seem to get any hint about "where" the
path is to be completed:

| (defun tramp-mock--list-chroots (directory)
|   (message "default-directory = %S" default-directory)
|   (if (file-directory-p directory)
|       (mapcar (lambda (filename)
|                 (list nil (string-remove-suffix ".cfg" filename)))
|               (directory-files directory nil "^.*\\.cfg$" t))))
| (with-eval-after-load 'tramp
|   (add-to-list 'tramp-methods
|                '("mock"
|                  (tramp-login-program "mock")
|                  (tramp-login-args (("-r") ("%h") ("--shell" "--" "/usr/bin/env" "PROMPT_COMMAND=" "/bin/sh" "-l")))
|                  (tramp-remote-shell "/bin/sh")
|                  (tramp-remote-shell-args ("-i" "-c"))))
|   (tramp-set-completion-function "mock"
|                                  '((tramp-mock--list-chroots "/etc/mock")
|                                    (tramp-mock--list-chroots "~/.config/mock"))))

Now if I do C-c C-f /docker:id-of-a-container|mock: TAB,
default-directory is still (in my case) $HOME on the primary
system.

lisp/net/tramp-container.el appears to have code introduced
in Emacs 29.1 (?) that allows for multi-hop completion.

Is multi-hop completion not possible with TRAMP
2.5.4-pre/Emacs 28.3?

Tim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.