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

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

[elpa] externals/ergoemacs-mode cc8c354 106/325: Simplify ergoemacs-mode


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode cc8c354 106/325: Simplify ergoemacs-mode and remove ergoemacs-mode--update-theme-description
Date: Sat, 23 Oct 2021 18:48:32 -0400 (EDT)

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

    Simplify ergoemacs-mode and remove ergoemacs-mode--update-theme-description
---
 ergoemacs-mode.el | 99 +++++++++++++++++++++----------------------------------
 1 file changed, 37 insertions(+), 62 deletions(-)

diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index 26e7eeb..dab6c00 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -275,50 +275,47 @@ The `execute-extended-command' is now 
\\[execute-extended-command].
   :group 'ergoemacs-mode
   :keymap ergoemacs-menu-keymap
   (setq ergoemacs-mode--start-p t)
-  (if (and (not noninteractive)
-           (not ergoemacs-mode--start-p))
-      (if ergoemacs-mode
-          (message "Ergoemacs will be started.")
-        (message "Ergoemacs startup canceled."))
-    (setq ergoemacs-map--hashkey nil)
-    (unless ergoemacs-require--ini-p
-      (setq ergoemacs-require--ini-p :ini)
-      (when ergoemacs-require
-        (dolist (elt ergoemacs-require)
-          (apply #'ergoemacs-require elt))))
-    (let ((refresh-p ergoemacs-component-struct--refresh-variables))
-      (if ergoemacs-mode
-          (progn
-            (setq ergoemacs-mode--default-frame-alist nil)
-            (dolist (elt (reverse default-frame-alist))
-              (push elt ergoemacs-mode--default-frame-alist))
-            (run-hooks 'ergoemacs-mode-startup-hook)
-            (add-hook 'pre-command-hook #'ergoemacs-pre-command-hook)
-            (add-hook 'post-command-hook #'ergoemacs-post-command-hook)
-            (add-hook 'after-load-functions #'ergoemacs-after-load-functions)
-            (add-hook 'after-load-functions 
#'ergoemacs-mode-after-startup-run-load-hooks)
-
-            (setq ergoemacs-require--ini-p t)
-           (ergoemacs-setup-override-keymap)                       
-            (if refresh-p
-                (message "Ergoemacs-mode keys refreshed (%s)" 
ergoemacs-keyboard-layout)
-              (message "Ergoemacs-mode turned ON (%s)." 
ergoemacs-keyboard-layout)))
-
-        (modify-all-frames-parameters ergoemacs-mode--default-frame-alist)
-        (unless (assoc 'cursor-type ergoemacs-mode--default-frame-alist)
-          (modify-all-frames-parameters (list (cons 'cursor-type 'box))))
-        (setq ergoemacs-mode--default-frame-alist nil)
-        (run-hooks 'ergoemacs-mode-shutdown-hook)
-        (remove-hook 'post-command-hook #'ergoemacs-post-command-hook)
-        (remove-hook 'pre-command-hook #'ergoemacs-pre-command-hook)
-        (remove-hook 'after-load-functions #'ergoemacs-after-load-functions)
-        (unless refresh-p
-          (message "Ergoemacs-mode turned OFF.")
+  (setq ergoemacs-map--hashkey nil)
+  (unless ergoemacs-require--ini-p
+    (setq ergoemacs-require--ini-p :ini)
+    (when ergoemacs-require
+      (dolist (elt ergoemacs-require)
+        (apply #'ergoemacs-require elt))))
+  (let ((refresh-p ergoemacs-component-struct--refresh-variables))
+    ;; Turn on
+    (if ergoemacs-mode
+        (progn
+          (setq ergoemacs-mode--default-frame-alist nil)
+          (dolist (elt (reverse default-frame-alist))
+            (push elt ergoemacs-mode--default-frame-alist))
+          (run-hooks 'ergoemacs-mode-startup-hook)
+          (add-hook 'pre-command-hook #'ergoemacs-pre-command-hook)
+          (add-hook 'post-command-hook #'ergoemacs-post-command-hook)
+          (add-hook 'after-load-functions #'ergoemacs-after-load-functions)
+          (add-hook 'after-load-functions 
#'ergoemacs-mode-after-startup-run-load-hooks)
+
+          (setq ergoemacs-require--ini-p t)
+         (ergoemacs-setup-override-keymap)                       
+          (if refresh-p
+              (message "Ergoemacs-mode keys refreshed (%s)" 
ergoemacs-keyboard-layout)
+            (message "Ergoemacs-mode turned ON (%s)." 
ergoemacs-keyboard-layout)
+            )
           )
+      ;; Turn off
+      (modify-all-frames-parameters ergoemacs-mode--default-frame-alist)
+      (unless (assoc 'cursor-type ergoemacs-mode--default-frame-alist)
+        (modify-all-frames-parameters (list (cons 'cursor-type 'box))))
+      (setq ergoemacs-mode--default-frame-alist nil)
+      (run-hooks 'ergoemacs-mode-shutdown-hook)
+      (remove-hook 'post-command-hook #'ergoemacs-post-command-hook)
+      (remove-hook 'pre-command-hook #'ergoemacs-pre-command-hook)
+      (remove-hook 'after-load-functions #'ergoemacs-after-load-functions)
+      (unless refresh-p
+        (message "Ergoemacs-mode turned OFF.")
         )
       )
-    (setq ergoemacs-mode-started-p t)
     )
+  (setq ergoemacs-mode-started-p t)
   )
 
 (defvar ergoemacs--gzip (executable-find "gzip")
@@ -766,28 +763,6 @@ Valid values are:
   :group 'ergoemacs-mode)
 
 
-(defun ergoemacs-mode--update-theme-description ()
-  "Update theme description based on loaded themes."
-  (defcustom ergoemacs-theme (if (and (boundp 'ergoemacs-variant) 
ergoemacs-variant)
-                                 ergoemacs-variant
-                               (if (and (boundp 'ergoemacs-theme) 
ergoemacs-theme)
-                                   ergoemacs-theme
-                                 (if (getenv "ERGOEMACS_THEME")
-                                     (getenv "ERGOEMACS_THEME")
-                                   nil)))
-    (concat"Ergoemacs Keyboard Layout Themes.
-This is a mirror of the environment variable ERGOEMACS_THEME.
-
-Valid values are:
-"
-           (ergoemacs-theme--custom-documentation))
-    :type (ergoemacs-theme--customization-type)
-    :set 'ergoemacs-set-default
-    :initialize #'custom-initialize-default
-    :group 'ergoemacs-mode))
-
-(add-hook 'ergoemacs-mode-startup-hook 
#'ergoemacs-mode--update-theme-description)
-
 (defcustom ergoemacs-remap-ignore '(undo-tree-visualize)
   "Functions to ignore in `ergoemacs-mode' remaps."
   :type '(repeat (sexp :tag "Function"))



reply via email to

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