From 14e4b3d1feffce18755bec31fbb73b3f6d5ff082 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Thu, 16 Feb 2023 10:50:09 +0700 Subject: [PATCH] Save the theme as soon as you pick it, so new emacs pick it up --- .config/emacs/init.org | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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