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

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

[elpa] externals/ergoemacs-mode 8b40059 102/325: Replace ergoemacs-theme


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode 8b40059 102/325: Replace ergoemacs-theme--list with hard coded "standard"
Date: Sat, 23 Oct 2021 18:48:31 -0400 (EDT)

branch: externals/ergoemacs-mode
commit 8b400594933a63cd2648f747ec0bc50c85d57865
Author: Walter Landry <wlandry@caltech.edu>
Commit: Walter Landry <wlandry@caltech.edu>

    Replace ergoemacs-theme--list with hard coded "standard"
---
 ergoemacs-lib.el          | 56 ++++++++++++++++++++++++-----------------------
 ergoemacs-theme-engine.el | 20 +++--------------
 ergoemacs-translate.el    |  4 +---
 3 files changed, 33 insertions(+), 47 deletions(-)

diff --git a/ergoemacs-lib.el b/ergoemacs-lib.el
index 7050c9a..75688d6 100644
--- a/ergoemacs-lib.el
+++ b/ergoemacs-lib.el
@@ -60,7 +60,6 @@
 
 (declare-function ergoemacs-autoloadp "ergoemacs-macros")
 (declare-function ergoemacs-mode-reset "ergoemacs-mode")
-(declare-function ergoemacs-theme--list "ergoemacs-theme-engine")
 (declare-function ergoemacs-theme-option-on "ergoemacs-theme-engine")
 
 (declare-function ergoemacs-key-description--menu "ergoemacs-key-description")
@@ -252,32 +251,35 @@ ergoemacs THEME."
             (let (ergoemacs-mode)
               (ergoemacs-require new-option theme type)))
         (let ((option-sym
-               (or (and option (stringp option) (intern option)) option)))
-          (dolist (theme (or (and theme (or (and (eq (type-of theme) 'cons) 
theme) (list theme)))
-                             (ergoemacs-theme--list)))
-            (let ((theme-plist (ergoemacs-gethash (if (and theme (stringp 
theme)) theme
-                                                    (symbol-name theme))
-                                                  ergoemacs-theme-hash))
-                  comp on off)
-              (setq comp (plist-get theme-plist :components)
-                    on (plist-get theme-plist :optional-on)
-                    off (plist-get theme-plist :optional-off))
-              (setq comp (delq option-sym comp)
-                    on (delq option-sym on)
-                    off (delq option-sym off))
-              (cond
-               (remove) ;; Don't do anything.
-               ((or (not type) (memq type '(required-hidden :required-hidden)))
-                (push option-sym comp))
-               ((memq type '(off :off))
-                (push option-sym off))
-               ((memq type '(on :on))
-                (push option-sym on)))
-              (setq theme-plist (plist-put theme-plist :components comp))
-              (setq theme-plist (plist-put theme-plist :optional-on on))
-              (setq theme-plist (plist-put theme-plist :optional-off off))
-              (puthash (if (and theme (stringp theme)) theme (symbol-name 
theme)) theme-plist
-                       ergoemacs-theme-hash)))))
+               (or (and option (stringp option) (intern option)) option))
+              (theme "standard")
+              )
+          (let ((theme-plist (ergoemacs-gethash (if (and theme (stringp 
theme)) theme
+                                                  (symbol-name theme))
+                                                ergoemacs-theme-hash))
+                comp on off)
+            (setq comp (plist-get theme-plist :components)
+                  on (plist-get theme-plist :optional-on)
+                  off (plist-get theme-plist :optional-off))
+            (setq comp (delq option-sym comp)
+                  on (delq option-sym on)
+                  off (delq option-sym off))
+            (cond
+             (remove) ;; Don't do anything.
+             ((or (not type) (memq type '(required-hidden :required-hidden)))
+              (push option-sym comp))
+             ((memq type '(off :off))
+              (push option-sym off))
+             ((memq type '(on :on))
+              (push option-sym on)))
+            (setq theme-plist (plist-put theme-plist :components comp))
+            (setq theme-plist (plist-put theme-plist :optional-on on))
+            (setq theme-plist (plist-put theme-plist :optional-off off))
+            (puthash (if (and theme (stringp theme)) theme (symbol-name 
theme)) theme-plist
+                     ergoemacs-theme-hash)
+            )
+          )
+        )
     (unless (eq ergoemacs-require--ini-p :ini)
       (ergoemacs-theme-option-on option t))))
 
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index f07bf3e..091a4af 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -175,27 +175,13 @@ If OFF is non-nil, turn off the options instead."
     (ergoemacs-theme-option-on option)))
 
 
-(defun ergoemacs-theme--list (&optional silent)
-  "Gets the list of themes.
-When SILENT is true, also include silent themes"
-  (let (ret)
-    ;; All this is done to copy lists so that sorts will not
-    ;; destroy the final list.  Please keep this here so that errors
-    ;; will not be introduced (seems silly)
-    (setq ret (mapcar (lambda(x) x)
-           (or (and silent
-                    (append (ergoemacs-gethash "defined-themes" 
ergoemacs-theme-hash)
-                            (ergoemacs-gethash "silent-themes" 
ergoemacs-theme-hash)))
-               (ergoemacs-gethash "defined-themes" ergoemacs-theme-hash))))
-    ret))
-
 (defun ergoemacs-theme--custom-documentation (&optional themes ini)
   "Get list of all known layouts and their documentation.
 
 THEMES is the list of themes for the customize documentation.
 
 INI is provided for initilazation, to shorten the descriptions."
-  (let ((themes (or themes (sort (ergoemacs-theme--list) 'string<))))
+  (let ((themes (list "standard")))
     (mapconcat
      (lambda(theme)
        (if ini
@@ -210,13 +196,13 @@ INI is provided for initilazation, to shorten the 
descriptions."
     ,@(mapcar
        (lambda(elt)
          `(const :tag ,elt :value ,elt))
-       (sort (ergoemacs-theme--list t) 'string<))))
+       (list "standard"))))
 
 (defun ergoemacs-theme--regexp (&optional at-end)
   "Return a regexp of `ergoemacs-mode' themes.
 When AT-END is non-nil, append a $ to the regular expression."
   (let (ret)
-    (setq ret (regexp-opt (ergoemacs-theme--list t) 'symbols))
+    (setq ret (regexp-opt (list "standard") 'symbols))
     (when at-end
       (setq ret (concat ret "$")))
     ret))
diff --git a/ergoemacs-translate.el b/ergoemacs-translate.el
index de4e8c1..a1cde13 100644
--- a/ergoemacs-translate.el
+++ b/ergoemacs-translate.el
@@ -67,7 +67,6 @@
 (defvar ergoemacs-command-loop--universal-functions)
 
 (declare-function ergoemacs-layouts--list "ergoemacs-layouts")
-(declare-function ergoemacs-theme--list "ergoemacs-theme-engine")
 (declare-function ergoemacs-mode-reset "ergoemacs-mode")
 (declare-function ergoemacs-layouts--custom-documentation "ergoemacs-layouts")
 (declare-function ergoemacs-theme--custom-documentation 
"ergoemacs-theme-engine")
@@ -1082,8 +1081,7 @@ If there are no gui elements, retun nil."
   (let ((layouts (or (and all-layouts (sort (ergoemacs-layouts--list) 
'string<))
                      (and (eq (ergoemacs :layout) 'ergoemacs-layout-us) (list 
"us"))
                      (list "us" ergoemacs-keyboard-layout)))
-        (themes (or (and all-themes (sort (ergoemacs-theme--list) 'string<))
-                    (list ergoemacs-theme)))
+        (themes (list "standard"))
         (original-layout ergoemacs-keyboard-layout)
         (original-theme ergoemacs-theme)
         ret)



reply via email to

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