From: Gene Goykhman Date: Thu, 31 Aug 2023 15:09:36 +0000 (+0200) Subject: Allow enabling multi-hop container completion selectively by method X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d43a037bc3d691c45a8a4a53d696580752607598;p=emacs.git Allow enabling multi-hop container completion selectively by method * lisp/net/tramp-container.el: Check if METHOD is a member of `tramp-container-multi-hop-methods' before attempting completion. * lisp/net/tramp.el: Add custom variable `tramp-container-multi-hop-methods'. --- diff --git a/lisp/net/tramp-container.el b/lisp/net/tramp-container.el index 687092e7e95..a0ed9b71a9a 100644 --- a/lisp/net/tramp-container.el +++ b/lisp/net/tramp-container.el @@ -166,7 +166,7 @@ METHOD is the Tramp method to be used for \"ps\", either This function is used by `tramp-set-completion-function', please see its function help for a description of the format." (let ((default-directory - (or (and tramp-completion-remote-containers tramp--last-hop-directory) + (or (and (member method tramp-completion-multi-hop-methods) tramp--last-hop-directory) tramp-compat-temporary-file-directory)) (program (tramp-get-method-parameter (make-tramp-file-name :method method) 'tramp-login-program)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b34d3ff6695..754f135c315 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3009,8 +3009,8 @@ This function is added always in `tramp-get-completion-function' for all methods. Resulting data are derived from default settings." `((,(tramp-find-user method nil nil) ,(tramp-find-host method nil nil)))) -(defcustom tramp-completion-remote-containers nil - "Whether container hosts in multi-hop paths should be queried for completions." +(defcustom tramp-completion-multi-hop-methods `(,tramp-docker-method ,tramp-podman-method) + "Methods for which to attempt to provide completions over multi-hop connections." :version "30.1" :type 'boolean)