branch: externals/ef-themes
commit f3e0dcc537bab17eb7c6cbb185c02f926dd8f0e5
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Add ef-themes--current-theme helper function
---
ef-themes.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ef-themes.el b/ef-themes.el
index d348eaa15b..563c4b9809 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -63,15 +63,19 @@
(string-prefix-p "ef-" (symbol-name theme)))
custom-known-themes))
+(defun ef-themes--current-theme ()
+ "Return first enabled Ef theme."
+ (if-let ((themes (ef-themes--list-enabled-themes)))
+ (car themes)
+ (user-error "No enabled Ef theme could be found")))
+
(defun ef-themes--palette (theme)
"Return THEME palette as a symbol."
(intern (format "%s-palette" theme)))
(defun ef-themes--current-theme-palette ()
"Return palette of active Ef theme, else produce `user-error'."
- (if-let* ((themes (ef-themes--list-enabled-themes))
- (theme (car themes))
- (palette (ef-themes--palette theme)))
+ (if-let ((palette (ef-themes--palette (ef-themes--current-theme))))
palette
(user-error "No enabled Ef theme could be found")))