From 30e5cc59d7f78f5382c77dcadee05be770fab076 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sun, 19 Nov 2023 07:53:06 +0000 Subject: [PATCH] Set centralised autosave directory for emacs --- home/emacs/init.el | 5 +++++ home/emacs/init.org | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/home/emacs/init.el b/home/emacs/init.el index 53cc7a34..6c63c9aa 100644 --- a/home/emacs/init.el +++ b/home/emacs/init.el @@ -41,6 +41,10 @@ ;; Make shebang (#!) file executable when saved (add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p) +(setq backup-directory-alist '(("." . "~/.local/state/emacs/backups")) + tramp-backup-directory-alist backup-directory-alist + tramp-auto-save-directory "~/.local/state/emacs/backups") + (when (require 'package nil :noerror) (add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/")) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) @@ -564,6 +568,7 @@ message-sendmail-f-is-evil t message-sendmail-extra-arguments '("--read-envelope-from") message-send-mail-function #'message-send-mail-with-sendmail + message-auto-save-directory nil message-kill-buffer-on-exit t mail-user-agent 'mu4e-user-agent read-mail-command 'mu4e diff --git a/home/emacs/init.org b/home/emacs/init.org index e96197f1..58c92593 100644 --- a/home/emacs/init.org +++ b/home/emacs/init.org @@ -50,6 +50,12 @@ (add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p) #+END_SRC +** TODO Auto-save file settings +#+begin_src emacs-lisp :tangle yes + (setq backup-directory-alist '(("." . "~/.local/state/emacs/backups")) + tramp-backup-directory-alist backup-directory-alist + tramp-auto-save-directory "~/.local/state/emacs/backups") +#+end_src ** package-archive with priorities #+begin_src emacs-lisp :results output silent (when (require 'package nil :noerror) @@ -674,6 +680,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] '(kbd-mode . (:url "https://github.com/kmonad/kbd-mode")))) (use-package kbd-mode) #+end_src + * Internet ** Email #+BEGIN_SRC emacs-lisp @@ -682,6 +689,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] message-sendmail-f-is-evil t message-sendmail-extra-arguments '("--read-envelope-from") message-send-mail-function #'message-send-mail-with-sendmail + message-auto-save-directory nil message-kill-buffer-on-exit t mail-user-agent 'mu4e-user-agent read-mail-command 'mu4e @@ -1020,4 +1028,3 @@ For reference information, see [[https://orgmode.com][Org-mode website]] (with-eval-after-load 'pdf-tools (setq-default pdf-view-display-size 'fit-width))) #+END_SRC -