emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master c5bbf67: Reset `tramp-default-proxies-alist' in cas


From: Michael Albinus
Subject: [Emacs-diffs] master c5bbf67: Reset `tramp-default-proxies-alist' in case of errors
Date: Mon, 31 Dec 2018 09:11:23 -0500 (EST)

branch: master
commit c5bbf67d5ca36f83f57139f300a76dfc164dffba
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Reset `tramp-default-proxies-alist' in case of errors
    
    * lisp/net/tramp-sh.el (tramp-compute-multi-hops):
    Reset `tramp-default-proxies-alist' in case of errors.
---
 lisp/net/tramp-sh.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 991a210..06c1c2d 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4610,7 +4610,8 @@ Goes through the list `tramp-inline-compress-commands'."
 
 (defun tramp-compute-multi-hops (vec)
   "Expands VEC according to `tramp-default-proxies-alist'."
-  (let ((target-alist `(,vec))
+  (let ((saved-tdpa tramp-default-proxies-alist)
+       (target-alist `(,vec))
        (hops (or (tramp-file-name-hop vec) ""))
        (item vec)
        choices proxy)
@@ -4676,9 +4677,9 @@ Goes through the list `tramp-inline-compress-commands'."
       (while (setq item (pop choices))
        (when (or (not (tramp-get-method-parameter item 'tramp-login-program))
                  (tramp-get-method-parameter item 'tramp-copy-program))
-         (tramp-error
-          vec 'file-error
-          "Method `%s' is not supported for multi-hops."
+         (setq tramp-default-proxies-alist saved-tdpa)
+         (tramp-user-error
+          vec "Method `%s' is not supported for multi-hops."
           (tramp-file-name-method item)))))
 
     ;; Some methods ("su", "sg", "sudo", "doas", "ksu") do not use the
@@ -4696,8 +4697,9 @@ Goes through the list `tramp-inline-compress-commands'."
                '("%h") (tramp-get-method-parameter item 'tramp-login-args))
               ;; The host name must match previous hop.
               (string-match-p previous-host host))
+           (setq tramp-default-proxies-alist saved-tdpa)
            (tramp-user-error
-            item "Host name `%s' does not match `%s'" host previous-host))
+            vec "Host name `%s' does not match `%s'" host previous-host))
          (setq previous-host (concat "^" (regexp-quote host) "$")))))
 
     ;; Result.



reply via email to

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