comparison lisp/files.el @ 15269:b6381b3a6c99

(make-backup-file-name): Check msdos-long-file-names. (basic-save-buffer-1, make-auto-save-file-name): Likewise.
author Karl Heuer <kwzh@gnu.org>
date Tue, 21 May 1996 17:21:25 +0000
parents 4f2cfe6ee83c
children 19008fd7774d
comparison
equal deleted inserted replaced
15268:18af2c80d4a1 15269:b6381b3a6c99
1665 filename)))) 1665 filename))))
1666 1666
1667 (defun make-backup-file-name (file) 1667 (defun make-backup-file-name (file)
1668 "Create the non-numeric backup file name for FILE. 1668 "Create the non-numeric backup file name for FILE.
1669 This is a separate function so you can redefine it for customization." 1669 This is a separate function so you can redefine it for customization."
1670 (if (eq system-type 'ms-dos) 1670 (if (and (eq system-type 'ms-dos)
1671 (not (msdos-long-file-names)))
1671 (let ((fn (file-name-nondirectory file))) 1672 (let ((fn (file-name-nondirectory file)))
1672 (concat (file-name-directory file) 1673 (concat (file-name-directory file)
1673 (or 1674 (or
1674 (and (string-match "\\`[^.]+\\'" fn) 1675 (and (string-match "\\`[^.]+\\'" fn)
1675 (concat (match-string 0 fn) ".~")) 1676 (concat (match-string 0 fn) ".~"))
1918 (setq i 0) 1919 (setq i 0)
1919 (setq nogood t) 1920 (setq nogood t)
1920 ;; Find the temporary name to write under. 1921 ;; Find the temporary name to write under.
1921 (while nogood 1922 (while nogood
1922 (setq tempname (format 1923 (setq tempname (format
1923 (if (eq system-type 'ms-dos) 1924 (if (and (eq system-type 'ms-dos)
1925 (not (msdos-long-file-names)))
1924 "%s#%d.tm#" ; MSDOS limits files to 8+3 1926 "%s#%d.tm#" ; MSDOS limits files to 8+3
1925 "%s#tmp#%d") 1927 "%s#tmp#%d")
1926 dir i)) 1928 dir i))
1927 (setq nogood (file-exists-p tempname)) 1929 (setq nogood (file-exists-p tempname))
1928 (setq i (1+ i))) 1930 (setq i (1+ i)))
2417 "Return file name to use for auto-saves of current buffer. 2419 "Return file name to use for auto-saves of current buffer.
2418 Does not consider `auto-save-visited-file-name' as that variable is checked 2420 Does not consider `auto-save-visited-file-name' as that variable is checked
2419 before calling this function. You can redefine this for customization. 2421 before calling this function. You can redefine this for customization.
2420 See also `auto-save-file-name-p'." 2422 See also `auto-save-file-name-p'."
2421 (if buffer-file-name 2423 (if buffer-file-name
2422 (if (eq system-type 'ms-dos) 2424 (if (and (eq system-type 'ms-dos)
2425 (not (msdos-long-file-names)))
2423 (let ((fn (file-name-nondirectory buffer-file-name))) 2426 (let ((fn (file-name-nondirectory buffer-file-name)))
2424 (string-match "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'" fn) 2427 (string-match "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'" fn)
2425 (concat (file-name-directory buffer-file-name) 2428 (concat (file-name-directory buffer-file-name)
2426 "#" (match-string 1 fn) 2429 "#" (match-string 1 fn)
2427 "." (match-string 3 fn) "#")) 2430 "." (match-string 3 fn) "#"))