aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp.el10
1 files changed, 3 insertions, 7 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index cc3130e2122..398372883b3 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3153,15 +3153,11 @@ User is always nil."
3153 3153
3154(defun tramp-handle-file-name-directory (file) 3154(defun tramp-handle-file-name-directory (file)
3155 "Like `file-name-directory' but aware of Tramp files." 3155 "Like `file-name-directory' but aware of Tramp files."
3156 ;; Everything except the last filename thing is the directory. We 3156 (with-parsed-tramp-file-name file nil
3157 ;; cannot apply `with-parsed-tramp-file-name', because this expands 3157 (setf (tramp-file-name-localname v) nil)
3158 ;; the remote file name parts. This is a problem when we are in
3159 ;; file name completion.
3160 (let ((v (tramp-dissect-file-name file t)))
3161 ;; Run the command on the localname portion only. 3158 ;; Run the command on the localname portion only.
3162 (tramp-make-tramp-file-name 3159 (tramp-make-tramp-file-name
3163 v (tramp-run-real-handler 3160 v (tramp-run-real-handler'file-name-directory (list localname)))))
3164 'file-name-directory (list (or (tramp-file-name-localname v) ""))))))
3165 3161
3166(defun tramp-handle-file-name-nondirectory (file) 3162(defun tramp-handle-file-name-nondirectory (file)
3167 "Like `file-name-nondirectory' but aware of Tramp files." 3163 "Like `file-name-nondirectory' but aware of Tramp files."