changeset 13885:bcb436f256e3

(make-auto-save-file-name): Make name always end in #, i.e. overwrite third char in extension if required.
author Richard M. Stallman <rms@gnu.org>
date Fri, 29 Dec 1995 03:36:35 +0000
parents 26245345f6f1
children d7591ab6c259
files lisp/files.el
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Thu Dec 28 23:58:12 1995 +0000
+++ b/lisp/files.el	Fri Dec 29 03:36:35 1995 +0000
@@ -2342,10 +2342,16 @@
 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.)