]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow enabling multi-hop container completion selectively by method
authorGene Goykhman <gene@indigo1.com>
Thu, 31 Aug 2023 15:09:36 +0000 (17:09 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 31 Aug 2023 15:09:36 +0000 (17:09 +0200)
* 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'.

lisp/net/tramp-container.el
lisp/net/tramp.el

index 687092e7e959111d9d12bb79a43b958e96ae8d90..a0ed9b71a9a298557a00121e8c46cd26eff8da74 100644 (file)
@@ -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))
index b34d3ff66957c44d84134f394bc2f7551d56e9e8..754f135c31540b82b1b4514d77952cbdc265d42a 100644 (file)
@@ -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)