summaryrefslogtreecommitdiff
path: root/lisp/net/tramp.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2018-05-24 16:55:16 +0200
committerMichael Albinus <michael.albinus@gmx.de>2018-05-24 16:55:16 +0200
commit9fe9f21515ccb4562269cc6ce8dfcebc4cd11384 (patch)
treeaa26d99797ddc401bd01e70f27304e3043cdaa44 /lisp/net/tramp.el
parent5444cb5f6867d43d1c21f30949e2002d8450cbc2 (diff)
downloademacs-9fe9f21515ccb4562269cc6ce8dfcebc4cd11384.tar.gz
emacs-9fe9f21515ccb4562269cc6ce8dfcebc4cd11384.tar.bz2
emacs-9fe9f21515ccb4562269cc6ce8dfcebc4cd11384.zip
Fix file name completion in Tramp
* lisp/net/tramp.el (tramp-handle-file-name-directory): Fix case of localname starts w/o a slash. * test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name): Extend test.
Diffstat (limited to 'lisp/net/tramp.el')
-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."
(defun tramp-handle-file-name-directory (file)
"Like `file-name-directory' but aware of 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. This is a problem when we are in
- ;; file name completion.
- (let ((v (tramp-dissect-file-name file t)))
+ (with-parsed-tramp-file-name file nil
+ (setf (tramp-file-name-localname v) nil)
;; Run the command on the localname portion only.
(tramp-make-tramp-file-name
- v (tramp-run-real-handler
- 'file-name-directory (list (or (tramp-file-name-localname v) ""))))))
+ v (tramp-run-real-handler'file-name-directory (list localname)))))
(defun tramp-handle-file-name-nondirectory (file)
"Like `file-name-nondirectory' but aware of Tramp files."