aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-08-28 22:16:42 +0000
committerRichard M. Stallman2002-08-28 22:16:42 +0000
commitd7b6ca4a9f4432a94d9000c35f32144874faf4ea (patch)
tree28a29371148ec06880587312a6d434914b27ddbb
parent2fb79329b5c58041da276ace62b9475fe3c78317 (diff)
downloademacs-d7b6ca4a9f4432a94d9000c35f32144874faf4ea.tar.gz
emacs-d7b6ca4a9f4432a94d9000c35f32144874faf4ea.zip
(make-auto-save-file-name, make-backup-file-name-1):
Don't use directory-sep-char.
-rw-r--r--lisp/files.el19
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 2d129c888e5..0cb3fddecea 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2574,7 +2574,7 @@ doesn't exist, it is created."
2574(defun make-backup-file-name-1 (file) 2574(defun make-backup-file-name-1 (file)
2575 "Subroutine of `make-backup-file-name' and `find-backup-file-name'." 2575 "Subroutine of `make-backup-file-name' and `find-backup-file-name'."
2576 (let ((alist backup-directory-alist) 2576 (let ((alist backup-directory-alist)
2577 elt backup-directory dir-sep-string) 2577 elt backup-directory)
2578 (while alist 2578 (while alist
2579 (setq elt (pop alist)) 2579 (setq elt (pop alist))
2580 (if (string-match (car elt) file) 2580 (if (string-match (car elt) file)
@@ -2589,29 +2589,28 @@ doesn't exist, it is created."
2589 (if (file-name-absolute-p backup-directory) 2589 (if (file-name-absolute-p backup-directory)
2590 (progn 2590 (progn
2591 (when (memq system-type '(windows-nt ms-dos)) 2591 (when (memq system-type '(windows-nt ms-dos))
2592 ;; Normalize DOSish file names: convert all slashes to 2592 ;; Normalize DOSish file names: downcase the drive
2593 ;; directory-sep-char, downcase the drive letter, if any, 2593 ;; letter, if any, and replace the leading "x:" with
2594 ;; and replace the leading "x:" with "/drive_x". 2594 ;; "/drive_x".
2595 (or (file-name-absolute-p file) 2595 (or (file-name-absolute-p file)
2596 (setq file (expand-file-name file))) ; make defaults explicit 2596 (setq file (expand-file-name file))) ; make defaults explicit
2597 ;; Replace any invalid file-name characters (for the 2597 ;; Replace any invalid file-name characters (for the
2598 ;; case of backing up remote files). 2598 ;; case of backing up remote files).
2599 (setq file (expand-file-name (convert-standard-filename file))) 2599 (setq file (expand-file-name (convert-standard-filename file)))
2600 (setq dir-sep-string (char-to-string directory-sep-char))
2601 (if (eq (aref file 1) ?:) 2600 (if (eq (aref file 1) ?:)
2602 (setq file (concat dir-sep-string 2601 (setq file (concat "/"
2603 "drive_" 2602 "drive_"
2604 (char-to-string (downcase (aref file 0))) 2603 (char-to-string (downcase (aref file 0)))
2605 (if (eq (aref file 2) directory-sep-char) 2604 (if (eq (aref file 2) ?/)
2606 "" 2605 ""
2607 dir-sep-string) 2606 "/")
2608 (substring file 2))))) 2607 (substring file 2)))))
2609 ;; Make the name unique by substituting directory 2608 ;; Make the name unique by substituting directory
2610 ;; separators. It may not really be worth bothering about 2609 ;; separators. It may not really be worth bothering about
2611 ;; doubling `!'s in the original name... 2610 ;; doubling `!'s in the original name...
2612 (expand-file-name 2611 (expand-file-name
2613 (subst-char-in-string 2612 (subst-char-in-string
2614 directory-sep-char ?! 2613 ?/ ?!
2615 (replace-regexp-in-string "!" "!!" file)) 2614 (replace-regexp-in-string "!" "!!" file))
2616 backup-directory)) 2615 backup-directory))
2617 (expand-file-name (file-name-nondirectory file) 2616 (expand-file-name (file-name-nondirectory file)
@@ -3563,7 +3562,7 @@ See also `auto-save-file-name-p'."
3563 (setq filename (concat 3562 (setq filename (concat
3564 (file-name-directory result) 3563 (file-name-directory result)
3565 (subst-char-in-string 3564 (subst-char-in-string
3566 directory-sep-char ?! 3565 ?/ ?!
3567 (replace-regexp-in-string "!" "!!" 3566 (replace-regexp-in-string "!" "!!"
3568 filename)))) 3567 filename))))
3569 (setq filename result))) 3568 (setq filename result)))