[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ef-themes e15123e1dc 01/10: Add ef-themes-load-random c
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ef-themes e15123e1dc 01/10: Add ef-themes-load-random command |
Date: |
Tue, 16 Aug 2022 23:57:34 -0400 (EDT) |
branch: externals/ef-themes
commit e15123e1dc2ffc4dc9f1bfec386c2f9c47563ad6
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add ef-themes-load-random command
---
README.org | 1 +
ef-themes.el | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/README.org b/README.org
index 792194bc4d..dd9569a49c 100644
--- a/README.org
+++ b/README.org
@@ -139,6 +139,7 @@ Everything is in place to set up the package.
;; We also provide these commands, but do not assign them to any key:
;;
;; - `ef-themes-select'
+;; - `ef-themes-load-random'
;; - `ef-themes-preview-colors'
;; - `ef-themes-preview-colors-current'
#+end_src
diff --git a/ef-themes.el b/ef-themes.el
index 5cb8c77073..c0ebab1df7 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -97,6 +97,23 @@ When called from Lisp, THEME is a symbol."
(mapc #'disable-theme (ef-themes--list-known-themes))
(load-theme theme :no-confirm))
+(defun ef-themes--minus-current ()
+ "Return list of Ef themes minus the current one."
+ (let* ((themes (copy-sequence (ef-themes--list-known-themes))))
+ (delete (ef-themes--current-theme) themes)))
+
+;;;###autoload
+(defun ef-themes-load-random ()
+ "Load an Ef theme at random, excluding the current one."
+ (interactive)
+ (let* ((themes (ef-themes--minus-current))
+ (n (random (length themes)))
+ (pick (nth n themes)))
+ (mapc #'disable-theme (ef-themes--list-known-themes))
+ (if (null pick)
+ (load-theme (car themes) :no-confim)
+ (load-theme pick :no-confim))))
+
(defun ef-themes--preview-colors-render (buffer theme &rest _)
"Render colors in BUFFER from THEME.
Routine for `ef-themes-preview-colors'."
- [elpa] externals/ef-themes updated (23b342f06a -> 48fc63f767), ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes e15123e1dc 01/10: Add ef-themes-load-random command,
ELPA Syncer <=
- [elpa] externals/ef-themes 7387c90219 02/10: Make ef-themes-load-random optional limit light/dark, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes ae9512f7c0 06/10: ef-day: change docstring mapping to cyan variant, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes f500017eac 08/10: ef-autumn: tweak {green, blue, cyan}-faint, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 9e8d6ac183 09/10: ef-autumn: tweak bg-info, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 310c3ea04a 03/10: ef-night: tweak cursor hue, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes e547eeeef0 04/10: ef-day: tweak blue-faint, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 2a9c62b906 05/10: ef-day: tweak cyan-faint, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 4de0999f53 07/10: Update contrast ratio table for ef-day, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 48fc63f767 10/10: Bump version to 0.0.2 (NOT ACTUAL RELEASE), ELPA Syncer, 2022/08/16