From: Karl Heuer Date: Tue, 19 Dec 1995 21:30:13 +0000 (+0000) Subject: (make-backup-file-name, backup-file-name-p): Use ~ even X-Git-Tag: emacs-19.34~2111 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=066327aee33f053201a83538078bd6f7f0240ce1;p=emacs.git (make-backup-file-name, backup-file-name-p): Use ~ even on ms-dos. --- diff --git a/lisp/files.el b/lisp/files.el index 3d95901772e..421f72752d6 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1596,18 +1596,18 @@ This is a separate function so you can redefine it for customization." (if (eq system-type 'ms-dos) (let ((fn (file-name-nondirectory file))) (concat (file-name-directory file) - (if (string-match "\\([^.]*\\)\\(\\..*\\)?" fn) - (substring fn 0 (match-end 1))) - ".bak")) + (or + (and (string-match "\\`[^.]+\\'" fn) + (concat (match-string 0 fn) ".~")) + (and (string-match "\\`[^.]+\\.\\(..?\\)?" fn) + (concat (match-string 0 fn) "~"))))) (concat file "~"))) (defun backup-file-name-p (file) "Return non-nil if FILE is a backup file name (numeric or not). This is a separate function so you can redefine it for customization. You may need to redefine `file-name-sans-versions' as well." - (if (eq system-type 'ms-dos) - (string-match "\\.bak$" file) - (string-match "~$" file))) + (string-match "~\\'" file)) ;; This is used in various files. ;; The usage of bv-length is not very clean,