diff options
| author | Michael Albinus | 2018-05-24 16:55:16 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-05-24 16:55:16 +0200 |
| commit | 9fe9f21515ccb4562269cc6ce8dfcebc4cd11384 (patch) | |
| tree | aa26d99797ddc401bd01e70f27304e3043cdaa44 /lisp | |
| parent | 5444cb5f6867d43d1c21f30949e2002d8450cbc2 (diff) | |
| download | emacs-9fe9f21515ccb4562269cc6ce8dfcebc4cd11384.tar.gz 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')
| -rw-r--r-- | lisp/net/tramp.el | 10 |
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." |