]> git.eshelyaron.com Git - emacs.git/commitdiff
Support autoloading Tramp extensions just in time
authorEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:02:18 +0000 (19:02 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:02:18 +0000 (19:02 +0200)
lisp/net/tramp.el

index 8961b872a8a622402b2daccc1095ab14de816c03..586999aebcb4bfb5873dee0f97fbbfb79939681c 100644 (file)
@@ -1794,7 +1794,13 @@ default values are used."
                     :port port :localname localname :hop hop))
          ;; The method must be known.
          (unless (or nodefault non-essential
-                     (assoc method tramp-methods))
+                     (assoc method tramp-methods)
+                      (when-let ((params-fun
+                                  (intern-soft
+                                   (format "tramp-%s-method-params" method)))
+                                 ((functionp params-fun))
+                                 (params (funcall params-fun)))
+                        (push (cons method params) tramp-methods)))
            (tramp-user-error
             v "Method `%s' is not known" method))
          ;; Only some methods from tramp-sh.el do support multi-hops.