aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-12-29 03:36:35 +0000
committerRichard M. Stallman1995-12-29 03:36:35 +0000
commit4503dacb37a7c27022c66bc615f0095b6f0f54bc (patch)
tree494c4eafd462be0cdfd3e6c73898bc29714e123d
parent4a60f8c52af49e7c6a8e13e9d73f1ca10df3279b (diff)
downloademacs-4503dacb37a7c27022c66bc615f0095b6f0f54bc.tar.gz
emacs-4503dacb37a7c27022c66bc615f0095b6f0f54bc.zip
(make-auto-save-file-name): Make name always end in #,
i.e. overwrite third char in extension if required.
-rw-r--r--lisp/files.el14
1 files changed, 10 insertions, 4 deletions
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
2342before calling this function. You can redefine this for customization. 2342before calling this function. You can redefine this for customization.
2343See also `auto-save-file-name-p'." 2343See also `auto-save-file-name-p'."
2344 (if buffer-file-name 2344 (if buffer-file-name
2345 (concat (file-name-directory buffer-file-name) 2345 (if (eq system-type 'ms-dos)
2346 "#" 2346 (let ((fn (file-name-nondirectory buffer-file-name)))
2347 (file-name-nondirectory buffer-file-name) 2347 (string-match "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'" fn)
2348 "#") 2348 (concat (file-name-directory buffer-file-name)
2349 "#" (match-string 1 fn)
2350 "." (match-string 3 fn) "#"))
2351 (concat (file-name-directory buffer-file-name)
2352 "#"
2353 (file-name-nondirectory buffer-file-name)
2354 "#"))
2349 2355
2350 ;; Deal with buffers that don't have any associated files. (Mail 2356 ;; Deal with buffers that don't have any associated files. (Mail
2351 ;; mode tends to create a good number of these.) 2357 ;; mode tends to create a good number of these.)