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

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

[elpa] 104/117: Respect global keys only if true global map


From: Matthew Fidler
Subject: [elpa] 104/117: Respect global keys only if true global map
Date: Fri, 25 Jul 2014 13:24:37 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit e0de2fba91c939fef58a83974c64c77900e6d1e0
Author: Matthew L. Fidler <address@hidden>
Date:   Thu Jul 24 09:11:51 2014 -0500

    Respect global keys only if true global map
---
 ergoemacs-advices.el |    4 ++--
 ergoemacs-mode.el    |    5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ergoemacs-advices.el b/ergoemacs-advices.el
index 8d1397d..168baa9 100644
--- a/ergoemacs-advices.el
+++ b/ergoemacs-advices.el
@@ -67,7 +67,7 @@ If `pre-command-hook' is used and `ergoemacs-mode' is remove 
from `ergoemacs-pre
         ergoemacs-read-shortcut-keys
         ergoemacs-read-no-shortcut-keys)
     ad-do-it))
-
+(defvar ergoemacs-global-map)
 (defadvice define-key (around ergoemacs-define-key-advice (keymap key def) 
activate)
   "This does the right thing when modifying `ergoemacs-keymap'.
 Also adds keymap-flag for user-defined keys run with `run-mode-hooks'."
@@ -85,7 +85,7 @@ Also adds keymap-flag for user-defined keys run with 
`run-mode-hooks'."
     ;;   (setq ergoemacs-local-emulation-mode-map-alist
     ;;         (list (cons 'ergoemacs-mode (make-sparse-keymap)))))
     (if (and ergoemacs-run-mode-hooks
-             (not (equal keymap (current-global-map)))
+             (not (equal keymap ergoemacs-global-map))
              (not (equal keymap ergoemacs-keymap)))
         (let ((ergoemacs-run-mode-hooks nil)
               (new-key (read-kbd-macro
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index 7071be3..85f04bf 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -465,6 +465,8 @@ When REMOVE is true, remove the emulations."
                            ergoemacs-no-shortcut-emulation-mode-map-alist)))
     (funcall (if remove #'remove-hook #'add-hook) 'emulation-mode-map-alists 
hook)))
 
+(defvar ergoemacs-global-map nil
+  "Saves the current global map to make sure the global changes are true.")
 (defvar ns-alternate-modifier)
 (defvar mac-alternate-modifier)
 (defvar ergoemacs-read-key-overriding-overlay-save)
@@ -508,7 +510,8 @@ bindings the keymap is:
   (if ergoemacs-mode
       (progn
         (setq ergoemacs-debug-heading-start-time (float-time)
-              ergoemacs-debug-heading-last-time (float-time))
+              ergoemacs-debug-heading-last-time (float-time)
+              ergoemacs-global-map (current-global-map))
         (ergoemacs-debug "* Ergoemacs-mode is turning ON.")
         (when cua-mode
           (cua-mode -1)



reply via email to

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