[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 115/117: Deferred keys now work for maps that are not modified
From: |
Matthew Fidler |
Subject: |
[elpa] 115/117: Deferred keys now work for maps that are not modified |
Date: |
Fri, 25 Jul 2014 13:24:42 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 7b2db539dd2f649f1b27ce511566de3868abba6d
Author: Matthew L. Fidler <address@hidden>
Date: Fri Jul 25 07:56:05 2014 -0500
Deferred keys now work for maps that are not modified
---
ergoemacs-theme-engine.el | 75 +++++++++++++++++++++++++++++++++++---------
1 files changed, 59 insertions(+), 16 deletions(-)
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 0bb99f6..3e218ec 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -572,8 +572,8 @@ This will return if the map object was modified.
(dolist (command def)
(if (not (commandp command t))
(push command tmp)
- (when ergoemacs-define-map--deferred
- (message "Found deferred %s, applying to
ergoemacs-mode" command))
+ ;; (when ergoemacs-define-map--deferred
+ ;; (message "Found deferred %s, applying to
ergoemacs-mode" command))
(define-key map key-vect command)
(ergoemacs-define-map--cmd-list obj key-desc def)
(oset obj map map)
@@ -754,11 +754,15 @@ Optionally use DESC when another description isn't found
in `ergoemacs-function-
(let (ret)
(with-slots (keymap-hash) obj
(maphash
- (lambda(_key fixed-obj)
- (setq ret (or (ergoemacs-apply-deferred fixed-obj) ret)))
+ (lambda(key fixed-obj)
+ (if (not fixed-obj)
+ (remhash key keymap-hash)
+ (let ((fix (ergoemacs-apply-deferred fixed-obj)))
+ (when fix
+ (puthash key fixed-obj keymap-hash))
+ (setq ret (or fix ret)))))
keymap-hash)
- (when ret
- (oset obj keymap-hash (make-hash-table))))
+ (oset obj keymap-hash keymap-hash))
ret))
(defclass ergoemacs-composite-map (eieio-named)
@@ -859,10 +863,15 @@ Optionally use DESC when another description isn't found
in `ergoemacs-function-
(defmethod ergoemacs-apply-deferred ((obj ergoemacs-composite-map))
(ergoemacs-composite-map--ini obj)
(when (with-slots (fixed variable) obj
- (let ((fixed-changed (ergoemacs-apply-deferred fixed))
- (var-changed (ergoemacs-apply-deferred variable)))
+ (let ((fixed-changed (and fixed (ergoemacs-apply-deferred fixed)))
+ (var-changed (and variable (ergoemacs-apply-deferred
variable))))
(or fixed-changed var-changed)))
(oset obj keymap-hash (make-hash-table))
+ ;; (with-slots (map object-name deferred-keys) (ergoemacs-get-fixed-map
obj)
+ ;; (setq ergoemacs-debug-keymap--temp-map map)
+ ;; (message "Composite Map: %s\n%s\nDeferred: %s"
+ ;; object-name (substitute-command-keys
"\\{ergoemacs-debug-keymap--temp-map}")
+ ;; deferred-keys))
t))
(defmethod ergoemacs-copy-obj ((obj ergoemacs-composite-map))
@@ -991,14 +1000,31 @@ Assumes maps are orthogonal."
(defmethod ergoemacs-apply-deferred ((obj ergoemacs-theme-component-maps))
(let (ret)
(with-slots (global maps) obj
- (setq ret (ergoemacs-apply-deferred global))
+ (setq ret (and global (ergoemacs-apply-deferred global)))
+ ;; (when ret
+ ;; (with-slots (map object-name deferred-keys)
(ergoemacs-get-fixed-map global)
+ ;; (setq ergoemacs-debug-keymap--temp-map map)
+ ;; (message "Global Map: %s\n%s\nDeferred: %s"
+ ;; object-name (substitute-command-keys
"\\{ergoemacs-debug-keymap--temp-map}")
+ ;; deferred-keys)))
(maphash
- (lambda(_key composite-map)
- (setq ret (or (ergoemacs-apply-deferred composite-map) ret)))
+ (lambda(key composite-map)
+ (let ((changed (and composite-map (ergoemacs-apply-deferred
composite-map))))
+ (when changed
+ (puthash key composite-map maps)
+ ;; (with-slots (map object-name deferred-keys)
(ergoemacs-get-fixed-map composite-map)
+ ;; (setq ergoemacs-debug-keymap--temp-map map)
+ ;; (message "Local : %s\n%s\nDeferred: %s"
+ ;; object-name (substitute-command-keys
"\\{ergoemacs-debug-keymap--temp-map}")
+ ;; deferred-keys))
+ )
+ (setq ret (or changed ret))))
maps)
(when ret ;; Reset fixed-maps hash
- (oset obj hooks (make-hash-table))
- (oset obj fixed-maps (make-hash-table))
+ (oset obj global global)
+ (oset obj maps maps)
+ ;; (oset obj hooks (make-hash-table))
+ (oset obj fixed-maps (make-hash-table)) ;; Reset cache
(ergoemacs-theme-component-maps--save-hash obj))
ret)))
@@ -1221,10 +1247,27 @@ Assumes maps are orthogonal."
(defmethod ergoemacs-apply-deferred ((obj ergoemacs-theme-component-map-list))
(let (ret)
(with-slots (map-list) obj
- (dolist (map map-list)
- (setq ret (or (ergoemacs-apply-deferred map) ret)))
+ (setq map-list
+ (mapcar
+ (lambda(new-map)
+ (let ((changed (and new-map (ergoemacs-apply-deferred
new-map))))
+ ;; (when changed
+ ;; (with-slots (map object-name deferred-keys)
(ergoemacs-get-fixed-map new-map 'log-edit-mode-map)
+ ;; (setq ergoemacs-debug-keymap--temp-map map)
+ ;; (message "Composite Map: %s\n%s\nDeferred: %s"
+ ;; object-name (substitute-command-keys
"\\{ergoemacs-debug-keymap--temp-map}")
+ ;; deferred-keys)))
+ (setq ret (or changed ret))
+ new-map))
+ map-list))
(when ret
- (oset obj hooks (make-hash-table :test 'equal))))
+ (oset obj map-list map-list)
+ (oset obj hooks (make-hash-table :test 'equal))
+ (setq ergoemacs-theme-component-map-list-fixed-hash (make-hash-table
:test 'equal))
+ ;; (with-slots (map) (ergoemacs-get-fixed-map obj 'log-edit-mode-map)
+ ;; (setq ergoemacs-debug-keymap--temp-map map)
+ ;; (message "%s" (substitute-command-keys
"\\{ergoemacs-debug-keymap--temp-map}")))
+ ))
ret))
(defmethod ergoemacs-theme-component-map-list-md5 ((obj
ergoemacs-theme-component-map-list))
- [elpa] 105/117: Add C-d test, (continued)
- [elpa] 105/117: Add C-d test, Matthew Fidler, 2014/07/25
- [elpa] 108/117: Move ergoemacs-translation-assoc declaration, Matthew Fidler, 2014/07/25
- [elpa] 104/117: Respect global keys only if true global map, Matthew Fidler, 2014/07/25
- [elpa] 107/117: Make sure the read-input-keymap has M-O and M-[. Possibly fix Issue #280, Matthew Fidler, 2014/07/25
- [elpa] 109/117: Fix extracting of prefixes, Matthew Fidler, 2014/07/25
- [elpa] 110/117: Add partial support of customize-set-variable, Matthew Fidler, 2014/07/25
- [elpa] 112/117: Add deferred keys for emulation-maps, Matthew Fidler, 2014/07/25
- [elpa] 111/117: Make sure ergoemacs-menus is loaded for any easymenu changes, Matthew Fidler, 2014/07/25
- [elpa] 114/117: Remap save-buffer to commit in log-edit-mode, Matthew Fidler, 2014/07/25
- [elpa] 116/117: Fix some undo bindings., Matthew Fidler, 2014/07/25
- [elpa] 115/117: Deferred keys now work for maps that are not modified,
Matthew Fidler <=
- [elpa] 117/117: v5.14.7.3 - Fixed some undo key bindings to work better with undo-tree - Now deferred key bindings work: When a function is undefined, it isn't added to the keymap until it becomes defined - Settings called within an ergoemacs-mode theme component block now will use customize-set-variable when they are a customizable variable. - Added some more globally defined keys to better characterize what is globally changed. - When saving settings, only save to the customize file once. - Turn off ergoemacs-mode and turn on ergoemacs-ini-mode before saving the settings. This allows ergoemacs-mode to be called when the initialization file calls it, hopefully taking care of some issues with keys changing if ergoemacs-mode is loaded before it resets the globally bound keymaps. - Added visual-line-mode support to the smart functions - Ergoemacs-mode no longer uses composed keymaps as final keymaps, so it is possible to extend to emacs 23 (will require interim composed maps so this function will need to be back-ported). - Allow ergoemacs-mode line to be turned off - Most of ergoemacs-mode has been changed to lexical scoping - Added partial support of guide-key-mode - Ergoemacs keyboard quit now looks up functions based on major mode, nd if "Q" and "C-g" are bound to something interesting, Matthew Fidler, 2014/07/25
- [elpa] 113/117: Only check for globally defined keys when setting up ergoemacs-mode keymaps, Matthew Fidler, 2014/07/25
- Prev by Date:
[elpa] 116/117: Fix some undo bindings.
- Next by Date:
[elpa] 117/117: v5.14.7.3 - Fixed some undo key bindings to work better with undo-tree - Now deferred key bindings work: When a function is undefined, it isn't added to the keymap until it becomes defined - Settings called within an ergoemacs-mode theme component block now will use customize-set-variable when they are a customizable variable. - Added some more globally defined keys to better characterize what is globally changed. - When saving settings, only save to the customize file once. - Turn off ergoemacs-mode and turn on ergoemacs-ini-mode before saving the settings. This allows ergoemacs-mode to be called when the initialization file calls it, hopefully taking care of some issues with keys changing if ergoemacs-mode is loaded before it resets the globally bound keymaps. - Added visual-line-mode support to the smart functions - Ergoemacs-mode no longer uses composed keymaps as final keymaps, so it is possible to extend to emacs 23 (will require interim composed maps so this function will need to be back-ported). - Allow ergoemacs-mode line to be turned off - Most of ergoemacs-mode has been changed to lexical scoping - Added partial support of guide-key-mode - Ergoemacs keyboard quit now looks up functions based on major mode, nd if "Q" and "C-g" are bound to something interesting
- Previous by thread:
[elpa] 116/117: Fix some undo bindings.
- Next by thread:
[elpa] 117/117: v5.14.7.3 - Fixed some undo key bindings to work better with undo-tree - Now deferred key bindings work: When a function is undefined, it isn't added to the keymap until it becomes defined - Settings called within an ergoemacs-mode theme component block now will use customize-set-variable when they are a customizable variable. - Added some more globally defined keys to better characterize what is globally changed. - When saving settings, only save to the customize file once. - Turn off ergoemacs-mode and turn on ergoemacs-ini-mode before saving the settings. This allows ergoemacs-mode to be called when the initialization file calls it, hopefully taking care of some issues with keys changing if ergoemacs-mode is loaded before it resets the globally bound keymaps. - Added visual-line-mode support to the smart functions - Ergoemacs-mode no longer uses composed keymaps as final keymaps, so it is possible to extend to emacs 23 (will require interim composed maps so this function will need to be back-ported). - Allow ergoemacs-mode line to be turned off - Most of ergoemacs-mode has been changed to lexical scoping - Added partial support of guide-key-mode - Ergoemacs keyboard quit now looks up functions based on major mode, nd if "Q" and "C-g" are bound to something interesting
- Index(es):