diff options
| author | Richard M. Stallman <rms@gnu.org> | 1992-10-23 11:06:14 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1992-10-23 11:06:14 +0000 |
| commit | 6861ad22b2fbbbd386138e5d0c56f8eadf485c51 (patch) | |
| tree | 48bc9da405aac94c83e811d0a7f2e42a2141c1ff | |
| parent | 45ca32a63ded7eefdb3e871430e1b2d679746401 (diff) | |
| download | emacs-6861ad22b2fbbbd386138e5d0c56f8eadf485c51.tar.gz | |
(set-visited-file-name): Change the auto save file name.
| -rw-r--r-- | lisp/files.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index b5ba9a55ef4..6a0737722dd 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -926,7 +926,14 @@ if you wish to pass an empty string as the argument." (setq backup-inhibited t))) ;; If auto-save was not already on, turn it on if appropriate. (if (not buffer-auto-save-file-name) - (auto-save-mode (and buffer-file-name auto-save-default))) + (auto-save-mode (and buffer-file-name auto-save-default)) + ;; If auto save is on, start using a new name. + ;; We deliberately don't rename or delete the old auto save + ;; for the old visited file name. This is because perhaps + ;; the user wants to save the new state and then compare with the + ;; previous state from the auto save file. + (setq buffer-auto-save-file-name + (make-auto-save-file-name))) (if buffer-file-name (set-buffer-modified-p t))) |
