-
Notifications
You must be signed in to change notification settings - Fork 0
/
backups.el
46 lines (34 loc) · 1.01 KB
/
backups.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
;;; package --- Summary
;;; Commentary:
;;; Code:
(defun bw/add-to-load-path (dir)
"Add `DIR' to 'load-path'."
(add-to-list 'load-path dir))
(defun bw/join-dirs (prefix suffix)
"Join `PREFIX' and `SUFFIX' into a directory."
(file-name-as-directory (concat prefix suffix)))
(defconst bw/dotfiles-dir
(file-name-directory
(or (buffer-file-name) load-file-name))
"Base path for customized Emacs configuration.")
(make-directory
(setq bw/tmp-local-dir
(bw/join-dirs bw/dotfiles-dir ".tmp"))
t)
(make-directory
(setq bw/tmp-backups-dir
(bw/join-dirs bw/tmp-local-dir "backups"))
t)
(make-directory
(setq bw/tmp-autosaves-dir
(bw/join-dirs bw/tmp-local-dir "autosaves"))
t)
(setq backup-directory-alist `((".*" . ,bw/tmp-backups-dir))
auto-save-file-name-transforms `((".*" ,bw/tmp-autosaves-dir)))
(setq backup-by-copying t)
(setq delete-old-versions t
kept-new-versions 2
kept-old-versions 2)
(setq version-control t)
(provide 'backups)
;;; backups.el ends here