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))
(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))))
(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
"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