2

The below settings in my .emacs make emacs (24.3) save multiple back-ups.

(setq delete-old-versions t
      kept-new-versions 6
      kept-old-versions 2
      version-control t)

However, I have little use for the newest 6 and oldest 2.

I'd like to distribute the back-ups. For example, keep the last saved version each day, and keep 5 versions for the present day.

  • 1
    Once you make it this complex, it's time to look at version control systems (such as Git, for example). I'm not sure whether there are Emacs packages which automate periodic commits, but that likely not be a problem after you learn to use a version control system, since you'd have different means of controlling what gets saved and when. – wvxvw Oct 7 '15 at 19:01
  • I agree with wvxvw; but FWIW you could probably implement your idea with some "after" advice for file-backup-file-name which processed the list of suggested deletions, and removed the names that you actually want to retain. – phils Oct 7 '15 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.