[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 88/287: Apply defered variables/modes. Fix Issue #216
From: |
Matthew Fidler |
Subject: |
[elpa] 88/287: Apply defered variables/modes. Fix Issue #216 |
Date: |
Wed, 02 Jul 2014 14:44:52 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 7fc106d0324a6ad3b232ba288a13cda9b530cf51
Author: Matthew L. Fidler <address@hidden>
Date: Fri Jun 13 08:44:44 2014 -0500
Apply defered variables/modes. Fix Issue #216
---
ergoemacs-theme-engine.el | 38 ++++++++++++++++++++++++--------------
1 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index a203b34..dda5cb8 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -1036,7 +1036,7 @@ ergoemacs-get-keymaps-for-hook OBJ HOOK")
(defvar ergoemacs-applied-inits '())
-(defmethod ergoemacs-apply-inits ((obj ergoemacs-theme-component-map-list))
+(defmethod ergoemacs-apply-inits-obj ((obj ergoemacs-theme-component-map-list))
(dolist (init (ergoemacs-get-inits obj))
(cond
((not (boundp (nth 0 init))) ;; Do nothing, not bound yet.
@@ -1310,13 +1310,15 @@ The actual keymap changes are included in
`ergoemacs-emulation-mode-map-alist'."
(let ((x (assq item minor-mode-map-alist)))
(when x
(setq minor-mode-map-alist (delq x minor-mode-map-alist)))))
- (ergoemacs-remove-inits))
+ (ergoemacs-remove-inits)
+ (remove-hook 'after-load-functions 'ergoemacs-apply-inits))
;; Setup `ergoemacs-mode' and `ergoemacs-unbind-keys'
(setq minor-mode-map-alist
`((ergoemacs-mode ,@final-map)
,@minor-mode-map-alist
(ergoemacs-unbind-keys ,@final-unbind-map)))
- (ergoemacs-apply-inits obj)
+ (ergoemacs-apply-inits-obj obj)
+ (add-hook 'after-load-functions 'ergoemacs-apply-inits)
(unwind-protect
(run-hooks 'ergoemacs-theme-hook)))
t)))
@@ -1876,22 +1878,30 @@ DONT-COLLAPSE doesn't collapse empty keymaps"
nil
ret)))
-(defun ergoemacs-theme-debug (&optional theme version)
- "Prints debugging information about the theme object."
- (interactive)
- (let* ((theme-obj (ergoemacs-theme-get-obj (or theme ergoemacs-theme)
version)))
- (ergoemacs-debug-obj theme-obj)))
-
-
+(defvar ergoemacs-theme--object nil
+ "Current `ergoemacs-mode' theme object")
(defun ergoemacs-theme-install (&optional theme version)
"Gets the keymaps for THEME for VERSION."
- (ergoemacs-theme-obj-install (ergoemacs-theme-get-obj (or theme
ergoemacs-theme) (or version (ergoemacs-theme-get-version)))))
+ (setq ergoemacs-theme--object (ergoemacs-theme-get-obj (or theme
ergoemacs-theme) (or version (ergoemacs-theme-get-version))))
+ (ergoemacs-theme-obj-install ergoemacs-theme--object))
+
+(defun ergoemacs-apply-inits (&rest ignore)
+ "Applies any deferred initializations."
+ (when ergoemacs-theme--object
+ (ergoemacs-apply-inits-obj ergoemacs-theme--object)))
+
+(defun ergoemacs-theme-debug ()
+ "Prints debugging information about the currently installed theme object."
+ (interactive)
+ (if ergoemacs-theme--object
+ (ergoemacs-debug-obj ergoemacs-theme--object)
+ (message "`ergoemacs-mode' isn't running a theme.")))
(defun ergoemacs-theme-remove ()
"Remove the currently installed theme and reset to emacs keys."
- (ergoemacs-theme-obj-install
- (ergoemacs-theme-get-obj
- ergoemacs-theme (ergoemacs-theme-get-version)) 'remove))
+ (when ergoemacs-theme--object
+ (ergoemacs-theme-obj-install ergoemacs-theme--object 'remove)
+ (setq ergoemacs-theme-object nil)))
(defun ergoemacs-theme-component--ignore-globally-defined-key (key)
"Adds KEY to `ergoemacs-global-override-rm-keys' and
`ergoemacs-global-override-map' if globally redefined."
- [elpa] 77/287: Ensure ergoemacs-global-override-rm-keys is a list of vectors, (continued)
- [elpa] 77/287: Ensure ergoemacs-global-override-rm-keys is a list of vectors, Matthew Fidler, 2014/07/02
- [elpa] 80/287: Reverse order to allow <apps> h z processing., Matthew Fidler, 2014/07/02
- [elpa] 82/287: Ignored keys shouldn't be in the shortcut hash, Matthew Fidler, 2014/07/02
- [elpa] 83/287: Allow ergoemacs-rm-key to remove a list, Matthew Fidler, 2014/07/02
- [elpa] 84/287: Break-out sending unread-command events, Matthew Fidler, 2014/07/02
- [elpa] 85/287: Keep track of shortcut key prefixes, Matthew Fidler, 2014/07/02
- [elpa] 81/287: Added version menu back, Matthew Fidler, 2014/07/02
- [elpa] 87/287: Remove "Z" in theme component, Matthew Fidler, 2014/07/02
- [elpa] 144/287: Generate image based on options, Matthew Fidler, 2014/07/02
- [elpa] 86/287: Always suppress shortcuts in read-key-lookup, Matthew Fidler, 2014/07/02
- [elpa] 88/287: Apply defered variables/modes. Fix Issue #216,
Matthew Fidler <=
- [elpa] 147/287: Allow emacs23 to fail., Matthew Fidler, 2014/07/02
- [elpa] 78/287: Faster ignore globally defined key, Matthew Fidler, 2014/07/02
- [elpa] 149/287: Backport `make-composed-keymap'., Matthew Fidler, 2014/07/02
- [elpa] 148/287: Fix more compiler issues and typos, Matthew Fidler, 2014/07/02
- [elpa] 145/287: pushnew instead of add-to-list, Matthew Fidler, 2014/07/02
- [elpa] 152/287: Remove emacs23 testing, Matthew Fidler, 2014/07/02
- [elpa] 150/287: Note that ergoemacs-mode requires emacs 24.1, Matthew Fidler, 2014/07/02
- [elpa] 153/287: Update expections., Matthew Fidler, 2014/07/02
- [elpa] 154/287: Remove ert dependence. Its in emacs 24, Matthew Fidler, 2014/07/02
- [elpa] 151/287: Try to make this a batch test., Matthew Fidler, 2014/07/02