]> git.eshelyaron.com Git - emacs.git/commitdiff
(make-auto-save-file-name): Make name always end in #,
authorRichard M. Stallman <rms@gnu.org>
Fri, 29 Dec 1995 03:36:35 +0000 (03:36 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 29 Dec 1995 03:36:35 +0000 (03:36 +0000)
i.e. overwrite third char in extension if required.

lisp/files.el

index dadf9c95a4b7eb0c2af0a2596b4fd62d506eae6b..969da941f895374e8e73422df4595f3d0ff1f9ce 100644 (file)
@@ -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.)