diff --git a/.config/emacs/init.org b/.config/emacs/init.org index 2ca053d..0e04942 100644 --- a/.config/emacs/init.org +++ b/.config/emacs/init.org @@ -222,12 +222,17 @@ our case is worse since we have a literate file. Send all custom variables to ~c (load custom-file) #+end_src -Save the last used theme when exiting emacs and then reload it. +Save the chosen theme after picking a new one #+begin_src emacs-lisp tangle: no -(defun joe/save-current-theme () - (customize-save-variable 'custom-enabled-themes custom-enabled-themes)) -(add-hook 'kill-emacs-hook #'joe/save-current-theme) +(defun joe/save-current-theme (THEME) + (let ((inhibit-message t) + (message-log-max nil)) + (customize-save-variable 'custom-enabled-themes custom-enabled-themes))) +;; (add-hook 'kill-emacs-hook #'joe/save-current-theme) +(advice-add 'consult-theme :after #'joe/save-current-theme) +(advice-remove 'load-theme 'joe/save-current-theme) + #+end_src *** Other