From: Richard M. Stallman Date: Fri, 29 Dec 1995 03:36:35 +0000 (+0000) Subject: (make-auto-save-file-name): Make name always end in #, X-Git-Tag: emacs-19.34~1975 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4503dacb37a7c27022c66bc615f0095b6f0f54bc;p=emacs.git (make-auto-save-file-name): Make name always end in #, i.e. overwrite third char in extension if required. --- diff --git a/lisp/files.el b/lisp/files.el index dadf9c95a4b..969da941f89 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2342,10 +2342,16 @@ Does not consider `auto-save-visited-file-name' as that variable is checked before calling this function. You can redefine this for customization. See also `auto-save-file-name-p'." (if buffer-file-name - (concat (file-name-directory buffer-file-name) - "#" - (file-name-nondirectory buffer-file-name) - "#") + (if (eq system-type 'ms-dos) + (let ((fn (file-name-nondirectory buffer-file-name))) + (string-match "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'" fn) + (concat (file-name-directory buffer-file-name) + "#" (match-string 1 fn) + "." (match-string 3 fn) "#")) + (concat (file-name-directory buffer-file-name) + "#" + (file-name-nondirectory buffer-file-name) + "#")) ;; Deal with buffers that don't have any associated files. (Mail ;; mode tends to create a good number of these.)