Watch
1
0
Fork
You've already forked ramb
0
Emacs package Really Actually Make Backups
  • Emacs Lisp 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026年05月06日 20:29:17 -04:00
LICENSE Add license: GPL 3 2026年05月03日 20:16:15 -04:00
ramb.el Make the shell-command buffers hidden " *shell-output*" 2026年05月06日 20:29:17 -04:00
README.org Add a screenshot 2026年05月05日 11:43:36 -04:00
screenshot.png Add a screenshot 2026年05月05日 11:43:36 -04:00

Really Actually Make Backups. Make a backup file every single time you save one of a list of precious files that you specify. Hide these overly-cautious overkill backups in a directory you specify.

"A screenshot."

I have a notes file where I jot everything down as it pops into my head or else I will forget it. Losing even the most recent twenty characters that I have typed into that file can be an annoyance. Inadvertently making a big deletion and saving can be disastrous. And the combination of real-auto-save and clumsy hands means that I can make a deletion and not notice until after many saves have taken place. I know Emacs has its own auto-save and auto-backup facility, but it has let me down enough times that I decided to write my own that is extra aggressive.

Installation and congifuration

Clone this repository into your Emacs load-path. Then add this declaration to your config file:

(use-package ramb
 :load-path "/home/user/path/to/your/elisp/files"
 :custom
 (ramb-backup-directory "./.overkill-backups")
 (ramb-backup-file-list `("/home/user/path/to/notes.org"
			 "/home/user/path/to/another/precious-file.txt")
 (ramb-directory-size-limit 30000) ;;; directory size limit in kb
 :hook
 (after-init . ramb-warn-maybe) ;;; side-effect: ensures backup directories exist
 (before-save . ramb-do-backups)
 :bind
 ("C-x C-b" . ramb-jump-to-backup-directory))

Notes

Be sure to add the function ramb-do-backups to before-save-hook.

Note that ramb-backup-directory can be an absolute path ("/home/user/path/to/backups/") in which case all backups will be stored there. Or it can be relative ("./.overkill-backups"), in which case backups for each file will be stored in that subdirectory next to each file.

ramb-backup-file-list should be a list of strings of absolute paths for each file to be backed up.

You can customize ramb-current-date-time-format to change the timestamp of each backup.

You can customize ramb-directory-size-limit to an integer that provokes a warning from the ramb-warn-maybe function when any backup directory exceeds that size. Add that function to e.g. after-init-hook to get periodic warnings. The warning level is the custom variable ramb-warning-level (default :warning).

The only interactive command is ramb-jump-to-backup-directory which dumps you into a dired window for that file's backup directory. I like to bind it globally to C-x C-b.

Hope this is useful. Feedback and contributions welcome.