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

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

[elpa] externals/ergoemacs-mode 615ec31 186/325: Really remove the start


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode 615ec31 186/325: Really remove the startup and shutdown hooks
Date: Sat, 23 Oct 2021 18:48:49 -0400 (EDT)

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

    Really remove the startup and shutdown hooks
---
 ergoemacs-command-loop.el |  3 ---
 ergoemacs-map.el          |  2 --
 ergoemacs-mode.el         | 23 ++++++++++++-----------
 3 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index fb007a4..389a634 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -201,9 +201,6 @@ with this function."
             (throw 'found-quit t)))
         nil))))
 
-(add-hook 'ergoemacs-mode-startup-hook 
#'ergoemacs-command-loop--setup-quit-key)
-(add-hook 'ergoemacs-mode-shutdown-hook 
#'ergoemacs-command-loop--redefine-quit-key)
-
 (dolist (arg '((next-key-is-alt (meta))
                (next-key-is-meta (meta))
                (next-key-is-ctl (control))
diff --git a/ergoemacs-map.el b/ergoemacs-map.el
index 8437a95..6c91319 100644
--- a/ergoemacs-map.el
+++ b/ergoemacs-map.el
@@ -1067,8 +1067,6 @@ When INI is non-nil, add conditional maps to 
`minor-mode-map-alist'."
     `("ErgoEmacs" . ,(ergoemacs-theme--menu)))
   )
 
-(add-hook 'ergoemacs-mode-startup-hook #'ergoemacs-map--install)
-
 (defvar ergoemacs-mode)
 
 (defvar ergoemacs-map-undefined-remaps
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index 9a2a2d9..541a2d3 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -288,24 +288,31 @@ The `execute-extended-command' is now 
\\[execute-extended-command].
     ;; Turn on
     (if ergoemacs-mode
         (progn
+          ;; Save frame parameters
           (setq ergoemacs-mode--default-frame-alist nil)
           (dolist (elt (reverse default-frame-alist))
             (push elt ergoemacs-mode--default-frame-alist))
+
+          ;; Setup the global keys that can be overriden
           (ergoemacs-install-standard-theme)
-          (run-hooks 'ergoemacs-mode-startup-hook)
-          (setq ergoemacs-require--ini-p t)
+          (ergoemacs-command-loop--setup-quit-key)
+          ;; Make the ErgoEmacs menu
+          (ergoemacs-map--install)
+          ;; Setup the main keys
           (ergoemacs-setup-override-keymap)                       
+          (setq ergoemacs-require--ini-p t)
+
           (if refresh-p
               (message "Ergoemacs-mode keys refreshed (%s)" 
ergoemacs-keyboard-layout)
             (message "Ergoemacs-mode turned ON (%s)." 
ergoemacs-keyboard-layout)
             )
           )
       ;; Turn off
+      ;; Restore frame parameters
       (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)
+
+      (ergoemacs-command-loop--redefine-quit-key)
       (unless refresh-p
         (message "Ergoemacs-mode turned OFF.")
         )
@@ -609,12 +616,6 @@ When STORE-P is non-nil, save the tables."
 
 (require 'cus-edit)
 
-(defvar ergoemacs-mode-startup-hook nil
-  "Hook for starting `ergoemacs-mode'.")
-
-(defvar ergoemacs-mode-shutdown-hook nil
-  "Hook for shutting down `ergoemacs-mode'.")
-
 (defvar ergoemacs-mode-intialize-hook nil
   "Hook for initializing `ergoemacs-mode'.")
 



reply via email to

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