tramp-devel
[Top][All Lists]
Advanced

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

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


From: Tim Landscheidt
Subject: Multi-hop completion with TRAMP 2.5.4-pre/Emacs 28.3?
Date: Fri, 26 Jan 2024 15:53:50 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux)

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



reply via email to

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