- Emacs Lisp 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| LICENSE | Add license: GPL 3 | |
| ramb.el | Make the shell-command buffers hidden " *shell-output*" | |
| README.org | Add a screenshot | |
| screenshot.png | Add a screenshot | |
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.