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

Make last Tramp change less invasive

* lisp/net/tramp.el (tramp-dissect-file-name): Revert last change.
(tramp-handle-file-name-as-directory)
(tramp-handle-file-name-directory): Let-bind `tramp-default-proxies-alist'.
This commit is contained in:
Michael Albinus 2023-05-25 15:40:45 +02:00
parent a72a1f24fc
commit 709d902002

View File

@ -1681,9 +1681,8 @@ The structure consists of method, user, domain, host, port,
localname (file name on remote host), and hop.
Unless NODEFAULT is non-nil, method, user and host are expanded
to their default values. Hop is set to nil if NODEFAULT is non-nil.
For the other file name parts, no default values are used."
to their default values. For the other file name parts, no
default values are used."
(save-match-data
(unless (tramp-tramp-file-p name)
(tramp-user-error nil "Not a Tramp file name: \"%s\"" name))
@ -1709,8 +1708,7 @@ For the other file name parts, no default values are used."
(when (string-match tramp-postfix-ipv6-regexp host)
(setq host (replace-match "" nil t host))))
(if nodefault
(setq hop nil)
(unless nodefault
(when hop
(setq v (tramp-dissect-hop-name hop)
hop (and hop (tramp-make-tramp-hop-name v))))
@ -3894,8 +3892,10 @@ Let-bind it when necessary.")
(defun tramp-handle-file-name-as-directory (file)
"Like `file-name-as-directory' for Tramp files."
;; `file-name-as-directory' would be sufficient except localname is
;; the empty string.
(let ((v (tramp-dissect-file-name file t)))
;; the empty string. Suppress adding a hop to
;; `tramp-default-proxies-alist' due to non-expanded default values.
(let ((v (tramp-dissect-file-name file t))
tramp-default-proxies-alist)
;; Run the command on the localname portion only unless we are in
;; completion mode.
(tramp-make-tramp-file-name
@ -3985,8 +3985,10 @@ Let-bind it when necessary.")
"Like `file-name-directory' for Tramp files."
;; Everything except the last filename thing is the directory. We
;; cannot apply `with-parsed-tramp-file-name', because this expands
;; the remote file name parts.
(let ((v (tramp-dissect-file-name file t)))
;; the remote file name parts. Suppress adding a hop to
;; `tramp-default-proxies-alist' due to non-expanded default values.
(let ((v (tramp-dissect-file-name file t))
tramp-default-proxies-alist)
;; Run the command on the localname portion only. If this returns
;; nil, mark also the localname part of `v' as nil.
(tramp-make-tramp-file-name