diff options
author | John Wiegley <johnw@newartisans.com> | 2017-12-01 12:42:58 -0800 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2017-12-01 12:42:58 -0800 |
commit | 1e25cd79ff28c8c84e5810e1a44a241fc8fac66c (patch) | |
tree | 2c56358ed3fffe6ed9c26bf9ebaae387c56ca239 /lisp | |
parent | f52d79500b2c78ad888691684de7e40cb7483df8 (diff) | |
download | emacs-1e25cd79ff28c8c84e5810e1a44a241fc8fac66c.tar.gz emacs-1e25cd79ff28c8c84e5810e1a44a241fc8fac66c.tar.bz2 emacs-1e25cd79ff28c8c84e5810e1a44a241fc8fac66c.zip |
Revert "Fix backing up remote files in local directories on MS-Windows"
This reverts commit 8c8b6732882248df4ca3b687e0a4b4e5e4ab3777.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/files.el | 54 |
1 files changed, 19 insertions, 35 deletions
diff --git a/lisp/files.el b/lisp/files.el index 9a79b2a0c73..8021e1bbed5 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4653,41 +4653,25 @@ The function `find-backup-file-name' also uses this." ;; "/drive_x". (or (file-name-absolute-p file) (setq file (expand-file-name file))) ; make defaults explicit - (cond - ((file-remote-p file) - ;; Remove the leading slash, if any, to prevent - ;; expand-file-name from adding a drive letter. - (and (memq (aref file 0) '(?/ ?\\)) - (setq file (substring file 1))) - ;; Replace any invalid file-name characters. - (setq file (convert-standard-filename file)) - ;; Replace slashes to make the file name unique, and - ;; prepend backup-directory. - (expand-file-name - (subst-char-in-string - ?/ ?! - (replace-regexp-in-string "!" "!!" - (concat "/" file))) - backup-directory)) - (t - ;; Replace any invalid file-name characters. - (setq file (expand-file-name (convert-standard-filename file))) - (if (eq (aref file 1) ?:) - (setq file (concat "/" - "drive_" - (char-to-string (downcase (aref file 0))) - (if (eq (aref file 2) ?/) - "" - "/") - (substring file 2)))) - ;; Make the name unique by substituting directory - ;; separators. It may not really be worth bothering about - ;; doubling `!'s in the original name... - (expand-file-name - (subst-char-in-string - ?/ ?! - (replace-regexp-in-string "!" "!!" file)) - backup-directory))))) + ;; Replace any invalid file-name characters (for the + ;; case of backing up remote files). + (setq file (expand-file-name (convert-standard-filename file))) + (if (eq (aref file 1) ?:) + (setq file (concat "/" + "drive_" + (char-to-string (downcase (aref file 0))) + (if (eq (aref file 2) ?/) + "" + "/") + (substring file 2))))) + ;; Make the name unique by substituting directory + ;; separators. It may not really be worth bothering about + ;; doubling `!'s in the original name... + (expand-file-name + (subst-char-in-string + ?/ ?! + (replace-regexp-in-string "!" "!!" file)) + backup-directory)) (expand-file-name (file-name-nondirectory file) (file-name-as-directory abs-backup-directory)))))) |