From 0a02a3dbb747c4c561075afe933d94434e7e9dbb Mon Sep 17 00:00:00 2001 From: David Florness Date: Wed, 13 Nov 2024 12:22:44 -0500 Subject: [PATCH] reorder theme function declarations in preparation for the macro we're about to define --- lisp/themes.el | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/lisp/themes.el b/lisp/themes.el index 27c5637..3bfac49 100644 --- a/lisp/themes.el +++ b/lisp/themes.el @@ -1,4 +1,22 @@ -;; install themes +(defun disable-current-themes () + "disabled all currently-enabled themes" + (interactive) + (dolist (thm custom-enabled-themes) + (disable-theme thm))) + +(defun switch-theme (theme) + ;; The (interactive ...) and subsequent (unless ...) code was copied from the + ;; enable-theme function in custom.el.gz + (interactive (list (intern + (completing-read + "Switch to custom theme: " + obarray (lambda (sym) (get sym 'theme-settings)) t)))) + (unless (custom-theme-p theme) + (error "Undefined Custom theme %s" theme)) + ;; end of copied code + + (disable-current-themes) + (enable-theme theme)) (use-package gruvbox-theme :config @@ -19,28 +37,6 @@ :config (load-theme 'zenburn t t)) -;; theme functions - -(defun switch-theme (theme) - ;; The (interactive ...) and subsequent (unless ...) code was copied from the - ;; enable-theme function in custom.el.gz - (interactive (list (intern - (completing-read - "Switch to custom theme: " - obarray (lambda (sym) (get sym 'theme-settings)) t)))) - (unless (custom-theme-p theme) - (error "Undefined Custom theme %s" theme)) - ;; end of copied code - - (disable-current-themes) - (enable-theme theme)) - -(defun disable-current-themes () - "disabled all currently-enabled themes" - (interactive) - (dolist (thm custom-enabled-themes) - (disable-theme thm))) - (defun dark-theme () (interactive) (switch-theme 'gruvbox-dark-hard)) -- 2.38.4