aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp.el35
1 files changed, 26 insertions, 9 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index fe0ba94f4c7..ab30a43de0d 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1391,19 +1391,36 @@ default values are used."
1391 (and hop 1391 (and hop
1392 (format-spec hop (format-spec-make ?h host ?u user)))))) 1392 (format-spec hop (format-spec-make ?h host ?u user))))))
1393 1393
1394 (make-tramp-file-name 1394 ;; Return result.
1395 :method method :user user :domain domain :host host :port port 1395 (prog1
1396 :localname localname :hop hop))))) 1396 (setq v (make-tramp-file-name
1397 :method method :user user :domain domain :host host
1398 :port port :localname localname :hop hop))
1399 ;; Only some methods from tramp-sh.el do support multi-hops.
1400 (when (and
1401 hop
1402 (or (not (tramp-get-method-parameter v 'tramp-login-program))
1403 (tramp-get-method-parameter v 'tramp-copy-program)))
1404 (tramp-user-error
1405 v "Method `%s' is not supported for multi-hops." method)))))))
1397 1406
1398(defun tramp-dissect-hop-name (name &optional nodefault) 1407(defun tramp-dissect-hop-name (name &optional nodefault)
1399 "Return a `tramp-file-name' structure of `hop' part of NAME. 1408 "Return a `tramp-file-name' structure of `hop' part of NAME.
1400See `tramp-dissect-file-name' for details." 1409See `tramp-dissect-file-name' for details."
1401 (tramp-dissect-file-name 1410 (let ((v (tramp-dissect-file-name
1402 (concat 1411 (concat tramp-prefix-format
1403 tramp-prefix-format 1412 (replace-regexp-in-string
1404 (replace-regexp-in-string 1413 (concat tramp-postfix-hop-regexp "$")
1405 (concat tramp-postfix-hop-regexp "$") tramp-postfix-host-format name)) 1414 tramp-postfix-host-format name))
1406 nodefault)) 1415 nodefault)))
1416 ;; Only some methods from tramp-sh.el do support multi-hops.
1417 (when (or (not (tramp-get-method-parameter v 'tramp-login-program))
1418 (tramp-get-method-parameter v 'tramp-copy-program))
1419 (tramp-user-error
1420 v "Method `%s' is not supported for multi-hops."
1421 (tramp-file-name-method v)))
1422 ;; Return result.
1423 v))
1407 1424
1408(defun tramp-buffer-name (vec) 1425(defun tramp-buffer-name (vec)
1409 "A name for the connection buffer VEC." 1426 "A name for the connection buffer VEC."