branch: externals/doric-themes
commit 1d57751f13b711c1bf29640535d19cd3d169f35a
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Avoid duplication in the :type of doric-themes-to-toggle
---
 doric-themes.el | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/doric-themes.el b/doric-themes.el
index cbf1d855f4..5c8ae554cd 100644
--- a/doric-themes.el
+++ b/doric-themes.el
@@ -60,17 +60,15 @@
   "Specify two themes for the `doric-themes-toggle' command.
 The variable `doric-themes-collection' contains the symbols of all
 themes that form part of this collection."
-  :type `(choice
-          (const :tag "No toggle (default)" nil)
-          (list :tag "Pick two themes to toggle between"
-                (choice :tag "Theme one of two"
-                        ,@(mapcar (lambda (theme)
-                                    (list 'const theme))
-                                  doric-themes-collection))
-                (choice :tag "Theme two of two"
-                        ,@(mapcar (lambda (theme)
-                                    (list 'const theme))
-                                  doric-themes-collection))))
+  :type (let ((themes (mapcar
+                       (lambda (theme)
+                         (list 'const theme))
+                       doric-themes-collection)))
+          `(choice
+            (const :tag "No toggle (default)" nil)
+            (list :tag "Pick two themes to toggle between"
+                  (choice :tag "Theme one of two" ,@themes)
+                  (choice :tag "Theme two of two" ,@themes))))
   :package-version '(doric-themes . "0.1.0")
   :group 'doric-themes)
 

Reply via email to