Mercurial > emacs
comparison lisp/files.el @ 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 | 4888716715e0 |
children | 936c8364e15a |
comparison
equal
deleted
inserted
replaced
13884:26245345f6f1 | 13885:bcb436f256e3 |
---|---|
2340 "Return file name to use for auto-saves of current buffer. | 2340 "Return file name to use for auto-saves of current buffer. |
2341 Does not consider `auto-save-visited-file-name' as that variable is checked | 2341 Does not consider `auto-save-visited-file-name' as that variable is checked |
2342 before calling this function. You can redefine this for customization. | 2342 before calling this function. You can redefine this for customization. |
2343 See also `auto-save-file-name-p'." | 2343 See 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.) |
2352 | 2358 |
2353 (let ((buffer-name (buffer-name)) | 2359 (let ((buffer-name (buffer-name)) |