help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When does emacs backup files?


From: Le Wang
Subject: Re: When does emacs backup files?
Date: Mon, 21 Feb 2011 13:10:49 +0800

On Sat, Feb 19, 2011 at 7:57 AM, orium <address@hidden> wrote:
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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]