1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

Fix regression when saving tramp-default-proxies-alist (Do not merge)

* lisp/net/tramp.el (tramp-add-hops): Suppress `signal-hook-function'.
Save `tramp-default-proxies-alist' only when changed.
This commit is contained in:
Michael Albinus 2023-05-29 11:22:54 +02:00
parent 3f44152567
commit 53dc7bec83

View File

@ -4624,7 +4624,9 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.")
"Add ad-hoc proxy definitions to `tramp-default-proxies-alist'."
(when-let ((hops (tramp-file-name-hop vec))
(item vec))
(dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit)))
(let (signal-hook-function changed)
(dolist
(proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit)))
(let* ((host-port (tramp-file-name-host-port item))
(user-domain (tramp-file-name-user-domain item))
(proxy (concat
@ -4635,14 +4637,16 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.")
(and (stringp user-domain)
(tramp-compat-rx bol (literal user-domain) eol))
(propertize proxy 'tramp-ad-hoc t))))
(tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry)
;; Add the hop.
(unless (member entry tramp-default-proxies-alist)
(tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry)
(add-to-list 'tramp-default-proxies-alist entry)
(setq changed t))
(setq item (tramp-dissect-file-name proxy))))
;; Save the new value.
(when tramp-save-ad-hoc-proxies
(when (and tramp-save-ad-hoc-proxies changed)
(customize-save-variable
'tramp-default-proxies-alist tramp-default-proxies-alist))))
'tramp-default-proxies-alist tramp-default-proxies-alist)))))
(defun tramp-compute-multi-hops (vec)
"Expands VEC according to `tramp-default-proxies-alist'."