Discussion:
When does emacs backup files?
orium
2011-02-18 23:57:15 UTC
Permalink
Hi,

I want my emacs to backup every file on save (with version control),
but for some reason i only have one version of each file.

My configuration is this:

(setq make-backup-files t)
(setq version-control t) ; Enable backup versioning
(setq delete-old-versions t) ; Don't ask about delete old versions of
backup
(setq kept-new-versions 1000000) ; Remember 1M versions of backup
(setq kept-old-versions 1000000)
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/"))))

How can have one new backup version created every time i save a file?
Peter Dyballa
2011-02-20 19:54:21 UTC
Permalink
Post by orium
How can have one new backup version created every time i save a file?
My setup is this:

(setq auto-save-interval 125)
(setq make-backup-files t ;backup my files
backup-by-copying t ;don't clobber symlinks
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t ;use versioned backups
vc-make-backup-files t ;make backups for cvs projects
vc-follow-symlinks t)
;; Backups to central location
(setq backup-directory-alist `(("." ,@(concat user-emacs-directory
"Sicherungen"))))


--
Greetings

Pete

A lot of us are working harder than we want, at things we don't like
to do. Why? ...In order to afford the sort of existence we don't care
to live.
– Bradford Angier
Teemu Likonen
2011-02-20 20:16:25 UTC
Permalink
Post by Peter Dyballa
(setq auto-save-interval 125)
(setq make-backup-files t ;backup my files
backup-by-copying t ;don't clobber symlinks
I think backup-by-copying variable has to do with _hard_ links, not
symlinks.
Peter Dyballa
2011-02-20 20:44:42 UTC
Permalink
Post by Teemu Likonen
Post by Peter Dyballa
(setq auto-save-interval 125)
(setq make-backup-files t ;backup my files
backup-by-copying t ;don't clobber symlinks
I think backup-by-copying variable has to do with _hard_ links, not
symlinks.
Ah, yes! I first introduced 'backup-by-copying t' when I saw that my
clever hard links changed a bit. Years later I found that block (a
larger one, actually) and adopted it – with the original comments
included. And that one comment is presumingly wrong...

Thanks! I'll make an update to my init file.

--
Greetings

Pete

These are my principles and if you don't like them... well, I have
others.
- Groucho Marx
Kevin Rodgers
2011-02-23 04:44:44 UTC
Permalink
Post by Teemu Likonen
Post by Peter Dyballa
(setq auto-save-interval 125)
(setq make-backup-files t ;backup my files
backup-by-copying t ;don't clobber symlinks
I think backup-by-copying variable has to do with _hard_ links, not
symlinks.
Ah, yes! I first introduced 'backup-by-copying t' when I saw that my clever hard
links changed a bit. Years later I found that block (a larger one, actually) and
adopted it – with the original comments included. And that one comment is
presumingly wrong...
Thanks! I'll make an update to my init file.
See the backup-by-copying-when-linked, -when-mismatch, and
-when-priveleged-mismatch variables for finer control over backups.
--
Kevin Rodgers
Denver, Colorado, USA
Peter Dyballa
2011-02-23 20:55:45 UTC
Permalink
Post by Kevin Rodgers
See the backup-by-copying-when-linked, -when-mismatch, and
-when-priveleged-mismatch variables for finer control over backups.
These variables (the last one actually backup-by-copying-when-
privileged-mismatch) play only then a role when backup-by-copying is
nil. The latter is non-nil. But it should be sufficient to let it be
nil and set backup-by-copying-when-linked to non-nil.

--
Mit friedvollen Grüßen

Pete

To drink without thirst and to make love all the time, madam, it is
only these which distinguish us from the other beasts.
– Beaumarchais

Le Wang
2011-02-21 05:10:49 UTC
Permalink
Post by orium
Hi,
I want my emacs to backup every file on save (with version control),
but for some reason i only have one version of each file.
If you read the description of `save-buffer', you'll see that this is by
design. I think this comes from the olden times when disk space was
precious.

How can have one new backup version created every time i save a file?
You can force a backup whenever you save, by mapping C-xC-s to something
like this:

(defun le::save-buffer-force-backup (arg)
"save buffer, always with a 2 \\[universal-argument]'s

see `save-buffer'

With ARG, don't force backup.
"
(interactive "P")
(if (and arg (listp arg))
(save-buffer)
(save-buffer 16)))
--
Le
Loading...