summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-07-14 18:20:35 +0200
committerAlan Pearce2023-07-14 18:20:35 +0200
commitec1179512fc8f65e5b2066450695a07f900fc22b (patch)
treeaa775f123bf0d2b4db17a39460b2b2f119ae8e83
parent6ef238e1d0315da79211c67fc273785e4dbdb185 (diff)
downloadnixfiles-ec1179512fc8f65e5b2066450695a07f900fc22b.tar.lz
nixfiles-ec1179512fc8f65e5b2066450695a07f900fc22b.tar.zst
nixfiles-ec1179512fc8f65e5b2066450695a07f900fc22b.zip
Emacs: automatically save state files whilst idle
-rw-r--r--user/emacs/init.el4
-rw-r--r--user/settings/emacs.nix1
2 files changed, 5 insertions, 0 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index f2c7bfca..05e7e295 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -220,6 +220,10 @@ With two prefix arguments, write out the day and month name."
   :config (progn
             (add-to-list 'savehist-additional-variables 'command-history)))
 
+(use-package persist-state
+  :if (bound-and-true-p server-process)
+  :ghook ('after-init-hook #'persist-state-mode))
+
 (use-package vertico
   :ghook ('after-init-hook #'vertico-mode))
 (use-package prescient
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index 725bc34c..cd0e316e 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -161,6 +161,7 @@ in
         marginalia
         nerd-icons
         doom-modeline
+        persist-state
         posframe
         quickrun
         rainbow-mode