diff options
| author | Michael Albinus | 2017-11-20 14:28:22 +0100 |
|---|---|---|
| committer | Michael Albinus | 2017-11-20 14:28:22 +0100 |
| commit | fc5b8f105505b4f9bb32c5d84d685ab0bc991802 (patch) | |
| tree | 58b5b21b869a93493e3620fb37348f957247ab0a | |
| parent | 5622b2e26337c531304ac7177a347edb92edf804 (diff) | |
| download | emacs-fc5b8f105505b4f9bb32c5d84d685ab0bc991802.tar.gz emacs-fc5b8f105505b4f9bb32c5d84d685ab0bc991802.zip | |
Fix Bug#29149
* lisp/net/tramp.el (tramp-drop-volume-letter): Handle also
backup file names.
(tramp-handle-find-backup-file-name):
Call `tramp-drop-volume-letter' on the results. (Bug#29149)
| -rw-r--r-- | lisp/net/tramp.el | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index aadfcadebcf..efd31b26be6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1858,7 +1858,8 @@ letter into the file name. This function removes it." | |||
| 1858 | (if (tramp-compat-file-name-quoted-p name) | 1858 | (if (tramp-compat-file-name-quoted-p name) |
| 1859 | 'tramp-compat-file-name-quote 'identity) | 1859 | 'tramp-compat-file-name-quote 'identity) |
| 1860 | (let ((name (tramp-compat-file-name-unquote name))) | 1860 | (let ((name (tramp-compat-file-name-unquote name))) |
| 1861 | (if (string-match "\\`[a-zA-Z]:/" name) | 1861 | ;; A volume letter could occur also in encoded backup file names. |
| 1862 | (if (string-match "\\(\\`[[:alpha:]]:/\\|/!drive_[[:alpha:]]\\)" name) | ||
| 1862 | (replace-match "/" nil t name) | 1863 | (replace-match "/" nil t name) |
| 1863 | name))))) | 1864 | name))))) |
| 1864 | 1865 | ||
| @@ -3222,21 +3223,23 @@ User is always nil." | |||
| 3222 | (defun tramp-handle-find-backup-file-name (filename) | 3223 | (defun tramp-handle-find-backup-file-name (filename) |
| 3223 | "Like `find-backup-file-name' for Tramp files." | 3224 | "Like `find-backup-file-name' for Tramp files." |
| 3224 | (with-parsed-tramp-file-name filename nil | 3225 | (with-parsed-tramp-file-name filename nil |
| 3225 | (let ((backup-directory-alist | 3226 | (mapcar |
| 3226 | (if tramp-backup-directory-alist | 3227 | 'tramp-drop-volume-letter |
| 3227 | (mapcar | 3228 | (let ((backup-directory-alist |
| 3228 | (lambda (x) | 3229 | (if tramp-backup-directory-alist |
| 3229 | (cons | 3230 | (mapcar |
| 3230 | (car x) | 3231 | (lambda (x) |
| 3231 | (if (and (stringp (cdr x)) | 3232 | (cons |
| 3232 | (file-name-absolute-p (cdr x)) | 3233 | (car x) |
| 3233 | (not (tramp-tramp-file-p (cdr x)))) | 3234 | (if (and (stringp (cdr x)) |
| 3234 | (tramp-make-tramp-file-name | 3235 | (file-name-absolute-p (cdr x)) |
| 3235 | method user domain host port (cdr x) hop) | 3236 | (not (tramp-tramp-file-p (cdr x)))) |
| 3236 | (cdr x)))) | 3237 | (tramp-make-tramp-file-name |
| 3237 | tramp-backup-directory-alist) | 3238 | method user domain host port (cdr x) hop) |
| 3238 | backup-directory-alist))) | 3239 | (cdr x)))) |
| 3239 | (tramp-run-real-handler 'find-backup-file-name (list filename))))) | 3240 | tramp-backup-directory-alist) |
| 3241 | backup-directory-alist))) | ||
| 3242 | (tramp-run-real-handler 'find-backup-file-name (list filename)))))) | ||
| 3240 | 3243 | ||
| 3241 | (defun tramp-handle-insert-directory | 3244 | (defun tramp-handle-insert-directory |
| 3242 | (filename switches &optional wildcard full-directory-p) | 3245 | (filename switches &optional wildcard full-directory-p) |