comparison lisp/files.el @ 44946:5eca5e9178c8

(make-auto-save-file-name): Specify # as suffix in the non-file-visiting case.
author Richard M. Stallman <rms@gnu.org>
date Sun, 28 Apr 2002 22:30:22 +0000
parents 54182658872c
children fd324d332ceb
comparison
equal deleted inserted replaced
44945:27acb2b2a2a9 44946:5eca5e9178c8
3370 ;; to the file name. 3370 ;; to the file name.
3371 (while (and list (not result)) 3371 (while (and list (not result))
3372 (if (string-match (car (car list)) filename) 3372 (if (string-match (car (car list)) filename)
3373 (setq result (replace-match (cadr (car list)) t nil 3373 (setq result (replace-match (cadr (car list)) t nil
3374 filename) 3374 filename)
3375 uniq (caddr (car list)))) 3375 uniq (caddr (car list))))
3376 (setq list (cdr list))) 3376 (setq list (cdr list)))
3377 (if result 3377 (if result
3378 (if uniq 3378 (if uniq
3379 (setq filename (concat 3379 (setq filename (concat
3380 (file-name-directory result) 3380 (file-name-directory result)
3381 (subst-char-in-string 3381 (subst-char-in-string
3382 directory-sep-char ?! 3382 directory-sep-char ?!
3383 (replace-regexp-in-string "!" "!!" 3383 (replace-regexp-in-string "!" "!!"
3384 filename)))) 3384 filename))))
3385 (setq filename result))) 3385 (setq filename result)))
3386 (setq result 3386 (setq result
3387 (if (and (eq system-type 'ms-dos) 3387 (if (and (eq system-type 'ms-dos)
3388 (not (msdos-long-file-names))) 3388 (not (msdos-long-file-names)))
3389 ;; We truncate the file name to DOS 8+3 limits 3389 ;; We truncate the file name to DOS 8+3 limits
3390 ;; before doing anything else, because the regexp 3390 ;; before doing anything else, because the regexp
3445 ;; buffer-name includes characters not allowed by the 3445 ;; buffer-name includes characters not allowed by the
3446 ;; DOS/Windows filesystems. make-temp-file writes to the 3446 ;; DOS/Windows filesystems. make-temp-file writes to the
3447 ;; file it creates, so we must fix the file name _before_ 3447 ;; file it creates, so we must fix the file name _before_
3448 ;; make-temp-file is called. 3448 ;; make-temp-file is called.
3449 (convert-standard-filename fname) 3449 (convert-standard-filename fname)
3450 fname)))))) 3450 fname))
3451 nil "#"))))
3451 3452
3452 (defun auto-save-file-name-p (filename) 3453 (defun auto-save-file-name-p (filename)
3453 "Return non-nil if FILENAME can be yielded by `make-auto-save-file-name'. 3454 "Return non-nil if FILENAME can be yielded by `make-auto-save-file-name'.
3454 FILENAME should lack slashes. You can redefine this for customization." 3455 FILENAME should lack slashes. You can redefine this for customization."
3455 (string-match "^#.*#$" filename)) 3456 (string-match "^#.*#$" filename))