[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ef-themes 1aa2f8138f 2/2: Refactor ef-themes--toggle-th
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ef-themes 1aa2f8138f 2/2: Refactor ef-themes--toggle-theme-p |
Date: |
Tue, 17 Dec 2024 06:58:16 -0500 (EST) |
branch: externals/ef-themes
commit 1aa2f8138fd44f59a599e7fb56822ec354688b38
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Refactor ef-themes--toggle-theme-p
It was returning ef-themes-to-toggle before, but the 'if' statement
inside of the mapc was not doing what it was stating (mapc does not
accumulate results).
This is a cleaner design.
---
ef-themes.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/ef-themes.el b/ef-themes.el
index d435a8f46c..2652d60292 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -656,12 +656,13 @@ whether it is light or dark."
(defun ef-themes--toggle-theme-p ()
"Return non-nil if `ef-themes-to-toggle' are valid."
- (mapc (lambda (theme)
- (if (or (memq theme ef-themes-collection)
- (memq theme (ef-themes--list-known-themes)))
- theme
- (user-error "`%s' is not part of `ef-themes-collection'" theme)))
- ef-themes-to-toggle))
+ (condition-case nil
+ (dolist (theme ef-themes-to-toggle)
+ (or (memq theme ef-themes-collection)
+ (memq theme (ef-themes--list-known-themes))
+ (error "`%s' is not part of `ef-themes-collection'" theme)))
+ (error nil)
+ (:success ef-themes-to-toggle)))
;;;; Toggle between two themes