emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ef-themes 462db0ffe3: Fix how themes are made available


From: ELPA Syncer
Subject: [elpa] externals/ef-themes 462db0ffe3: Fix how themes are made available at startup
Date: Thu, 18 Aug 2022 13:57:33 -0400 (EDT)

branch: externals/ef-themes
commit 462db0ffe37279010d9f2ba866b198ce66d0b7bc
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Fix how themes are made available at startup
    
    Thanks to Iris Garcia for informing me that the were not registered as
    "known" before.  This was done in issue 2 on the GitHub mirror:
    <https://github.com/protesilaos/ef-themes/issues/2>.
    
    The code I am adding here needs to be reviewed to simplify all the
    internal functions.  Thought it has been a very long day (again), so I
    will do that tomorrow.
---
 README.org   |  4 ++--
 ef-themes.el | 19 +++++++++++++------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/README.org b/README.org
index af562d8007..ff914f086a 100644
--- a/README.org
+++ b/README.org
@@ -363,8 +363,8 @@ matters.
 
 + Author/maintainer :: Protesilaos Stavrou.
 
-+ Ideas and/or user feedback :: Spike-Leung, Summer Emacs, Zoltán
-  Király.
++ Ideas and/or user feedback :: Iris Garcia, Spike-Leung, Summer Emacs,
+  Zoltán Király.
 
 * GNU Free Documentation License
 :PROPERTIES:
diff --git a/ef-themes.el b/ef-themes.el
index 324e869a7f..71d1430c25 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -48,6 +48,12 @@
 
 ;;; Commands and their helper functions
 
+(defconst ef-themes-light-themes '(ef-day ef-light ef-spring ef-summer)
+  "List of symbols with the light Ef themes.")
+
+(defconst ef-themes-dark-themes '(ef-autumn ef-dark ef-night ef-winter)
+  "List of symbols with the dark Ef themes.")
+
 (defun ef-themes--list-enabled-themes ()
   "Return list of `custom-enabled-themes' with ef- prefix."
   (seq-filter
@@ -62,6 +68,12 @@
      (string-prefix-p "ef-" (symbol-name theme)))
    custom-known-themes))
 
+(defun ef-themes--enable-themes ()
+  (mapc (lambda (theme)
+          (load-theme theme :no-confirm :no-enable))
+        (append ef-themes-light-themes
+                ef-themes-dark-themes)))
+
 (defun ef-themes--current-theme ()
   "Return first enabled Ef theme."
   (if-let ((themes (ef-themes--list-enabled-themes)))
@@ -108,12 +120,6 @@ When called from Lisp, THEME is a symbol."
   (interactive (list (intern (ef-themes--select-prompt))))
   (ef-themes--load-theme theme))
 
-(defconst ef-themes-light-themes '(ef-day ef-light ef-spring ef-summer)
-  "List of symbols with the light Ef themes.")
-
-(defconst ef-themes-dark-themes '(ef-autumn ef-dark ef-night ef-winter)
-  "List of symbols with the dark Ef themes.")
-
 (defun ef-themes--minus-current (&optional variant)
   "Return list of Ef themes minus the current one.
 VARIANT is either `light' or `dark', which stand for
@@ -140,6 +146,7 @@ prompts with completion for either `light' or `dark'."
    (list (when current-prefix-arg
            (intern (completing-read "Random choice of Ef themes VARIANT: "
                                     '(light dark) nil t)))))
+  (ef-themes--enable-themes)
   (let* ((themes (ef-themes--minus-current variant))
          (n (random (length themes)))
          (pick (nth n themes)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]