all repos — nixfiles @ ec1179512fc8f65e5b2066450695a07f900fc22b

System and user configuration, managed by nix and home-manager

Emacs: automatically save state files whilst idle
Alan Pearce alan@alanpearce.eu
Fri, 14 Jul 2023 18:20:35 +0200
commit

ec1179512fc8f65e5b2066450695a07f900fc22b

parent

6ef238e1d0315da79211c67fc273785e4dbdb185

2 files changed, 5 insertions(+), 0 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -220,6 +220,10 @@ :init (savehist-mode +1)   :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
M user/settings/emacs.nixuser/settings/emacs.nix
@@ -161,6 +161,7 @@ markdown-mode         marginalia
         nerd-icons
         doom-modeline
+        persist-state
         posframe
         quickrun
         rainbow-mode