[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs autosave behaviour
From: |
Damien Wyart |
Subject: |
Re: emacs autosave behaviour |
Date: |
Thu, 01 Aug 2013 14:17:44 +0200 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 |
* Jannis <bt_jannis@yahoo.de> in gnu.emacs.help:
> i would like the emacs autosave scheme to behave like the follwoing:
> - put all these ~* and #* files into one central directory and not the
> directory of the file edited
> - save several versions of these backup (in the same directory)
> To do so, I have put the following into .emacs:
> (custom-set-variables
> '(auto-save-file-name-transforms (quote ((".*"
> "~/.emacs.d/autosaves/\\1" t))))
> '(backup-directory-alist (quote ((".*" . "~/.emacs.d/autosaves/"))))
> '(comint-move-point-for-output (quote others))
This one has nothing to do with backups, this is a setting from Shell
mode.
> '(make-directory "~/.emacs.d/autosaves/" t)
> '(version-control t)
> '(kept-new-versions 5)
> '(kept-old-versions 5)
> )
> My problem now is that I get a backup version each time I open a file
> in a new emacs instance and save some changes. I would, however, like
> to have a version each time i hit save even if I open the file just
> once and save it several times.
> Any suggestion on how to accomplish this?
(From the Emacs manual)
,----
| Emacs makes a backup for a file only the first time the file is saved
| from a buffer. No matter how many times you subsequently save the
| file, its backup remains unchanged. However, if you kill the buffer
| and then visit the file again, a new backup file will be made.
|
| [...]
|
| You can explicitly tell Emacs to make another backup file from
| a buffer, even though that buffer has been saved before. If you save
| the buffer with C-u C-x C-s, the version thus saved will be made into
| a backup file if you save the buffer again. C-u C-u C-x C-s saves the
| buffer, but first makes the previous file contents into a new backup
| file. C-u C-u C-u C-x C-s does both things: it makes a backup from the
| previous contents, and arranges to make another from the newly saved
| contents if you save again.
`----
To go further, you can read these pages:
http://www.emacswiki.org/emacs/BackupEachSave (seems the most
recommended solution, but I have never used it)
http://www.emacswiki.org/emacs/ForceBackups
http://stackoverflow.com/questions/6916529/how-can-i-make-emacs-backup-every-time-i-save
--
DW