summary refs log tree commit diff
diff options
context:
space:
mode:
authornoa@gaiwan.org2024-06-23 10:39:12 +0000
committernoa@gaiwan.org2024-06-23 10:39:12 +0000
commitb37df6dbc7d6eb1941c79ac4d1ceb03043046ed0 (patch)
tree72301b54148ed173816884d59fb9c55704a129ca
parentd7f9607e3fe7fb3b5306dc867d3ac7b7637e7d5f (diff)
Add a backup directory
-rw-r--r--config.org33
1 files changed, 17 insertions, 16 deletions
diff --git a/config.org b/config.org
index 5440b11..3d428eb 100644
--- a/config.org
+++ b/config.org
@@ -1111,22 +1111,23 @@ Shift click to select region with the mouse.  This annoyingly rings the bell for
 Backups are pointless in long emacs sessions imo, but autosaves are useful.
 
 #+begin_src elisp
-(setopt remote-file-name-inhibit-auto-save t)
-(setopt remote-file-name-inhibit-auto-save-visited t)
-(setopt make-backup-files nil
-	backup-by-copying t
-	create-lockfiles nil
-	auto-save-mode 1
-	auto-save-interval 6  ;; every six keystrokes
-	auto-save-timeout 5 ;; every 5 seconds
-	auto-save-default t
-	auto-save-no-message t
-	save-silently t
-	version-control t
-	;; this will auto save to the current file
-	auto-save-visited-mode t)
-(add-hook 'focus-out-hook (lambda () (interactive) (save-some-buffers t)))
-(add-hook 'mouse-leave-buffer-hook (lambda () (interactive) (save-some-buffers t)))
+  (setopt remote-file-name-inhibit-auto-save t)
+  (setopt remote-file-name-inhibit-auto-save-visited t)
+  (setopt backup-directory-alist '(("." . "~/.config/emacs/backups/"))
+	  make-backup-files nil
+	  backup-by-copying t
+	  create-lockfiles nil
+	  auto-save-mode 1
+	  auto-save-interval 6  ;; every six keystrokes
+	  auto-save-timeout 5 ;; every 5 seconds
+	  auto-save-default t
+	  auto-save-no-message t
+	  save-silently t
+	  version-control t
+	  ;; this will auto save to the current file
+	  auto-save-visited-mode t)
+  (add-hook 'focus-out-hook (lambda () (interactive) (save-some-buffers t)))
+  (add-hook 'mouse-leave-buffer-hook (lambda () (interactive) (save-some-buffers t)))
 #+end_src
 
 ** Keyfreq