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

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

[elpa] externals/ef-themes 8155fd60db 037/281: Add command to select Ef


From: ELPA Syncer
Subject: [elpa] externals/ef-themes 8155fd60db 037/281: Add command to select Ef theme
Date: Tue, 16 Aug 2022 16:58:16 -0400 (EDT)

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

    Add command to select Ef theme
---
 ef-themes.el | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/ef-themes.el b/ef-themes.el
index e4382e02cc..ef9dd1320a 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -44,6 +44,35 @@
   :prefix "ef-themes-"
   :tag "Ef Themes")
 
+;;; Commands and their helper functions
+
+(defun ef-themes--list-enabled-themes ()
+  "Return list of `custom-enabled-themes' with ef- prefix."
+  (seq-filter
+   (lambda (theme)
+     (string-prefix-p "ef-" (symbol-name theme)))
+   custom-enabled-themes))
+
+(defconst ef-themes-themes '(ef-summer ef-winter)
+  "List of Ef Themes.")
+
+(defvar ef-themes--select-theme-history nil)
+
+(defun ef-themes--select-prompt ()
+  "Minibuffer prompt for `ef-themes-select'."
+  (completing-read "Select Ef Theme: "
+                   ef-themes-themes
+                   nil t nil
+                   'ef-themes--select-theme-history))
+
+;;;###autoload
+(defun ef-themes-select (theme)
+  "Load an Ef THEME using minibuffer completion.
+When called from Lisp, THEME is a symbol."
+  (interactive
+   (list (intern (ef-themes--select-prompt))))
+  (load-theme theme :no-confirm))
+
 ;;; Faces and variables
 
 (defconst ef-themes-faces



reply via email to

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