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

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

[elpa] 177/287: Remove cua-mode treatment in startup


From: Matthew Fidler
Subject: [elpa] 177/287: Remove cua-mode treatment in startup
Date: Wed, 02 Jul 2014 14:45:46 +0000

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

commit b8e76bb1a22d07d20b6b333a8d1311f2a3708c7c
Author: Matthew L. Fidler <address@hidden>
Date:   Thu Jun 19 14:48:15 2014 -0500

    Remove cua-mode treatment in startup
---
 ergoemacs-advices.el |   23 ++++++++++++++++++++++-
 ergoemacs-mode.el    |   29 -----------------------------
 2 files changed, 22 insertions(+), 30 deletions(-)

diff --git a/ergoemacs-advices.el b/ergoemacs-advices.el
index 451aa91..0b0c59f 100644
--- a/ergoemacs-advices.el
+++ b/ergoemacs-advices.el
@@ -120,9 +120,30 @@ Also adds keymap-flag for user-defined keys run with 
`run-mode-hooks'."
 
 (defadvice cua-mode (around ergoemacs-activate-only-selection-mode (arg) 
activate)
   "When `ergoemacs-mode' is enabled, enable `cua-selection-mode' instead of 
plain `cua-mode'."
-  (when ergoemacs-mode 
+  (when ergoemacs-mode
+    ;; Do NOT allow cua-mode to do the C-x and C-c
+    ;; hack, `ergoemacs-mode' needs to do a similar hack to allow
+    ;; backspace in key sequences.
     (setq-default cua-enable-cua-keys nil))
   ad-do-it
+  ;; Reset `cua--keymap-alist' -- make it compatible with
+  ;; `ergoemacs-mode'
+  (setq cua--rectangle-keymap (make-sparse-keymap))
+  (setq cua--rectangle-initialized nil)
+  (if ergoemacs-mode
+      (setq cua--rectangle-modifier-key ergoemacs-cua-rect-modifier)
+    (setq cua--rectangle-modifier-key 'meta))
+  (cua--init-rectangles)
+  (setq cua--keymap-alist
+        (progn
+          (cua--init-rectangles)
+          `((cua--ena-prefix-override-keymap . ,cua--prefix-override-keymap)
+            (cua--ena-prefix-repeat-keymap . ,cua--prefix-repeat-keymap)
+            (cua--ena-cua-keys-keymap . ,cua--cua-keys-keymap)
+            (cua--ena-global-mark-keymap . ,cua--global-mark-keymap)
+            (cua--rectangle . ,cua--rectangle-keymap)
+            (cua--ena-region-keymap . ,cua--region-keymap)
+            (cua-mode . ,cua-global-keymap))))
   (when (and (boundp 'ergoemacs-mode) ergoemacs-mode)
     (customize-mark-as-set 'cua-enable-cua-keys)))
 
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index c9a12d7..e338930 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -213,8 +213,6 @@ Valid values are:
   :initialize #'custom-initialize-default
   :group 'ergoemacs-mode)
 
-(defvar ergoemacs-cua-rect-modifier-orig cua--rectangle-modifier-key)
-
 (defcustom ergoemacs-cua-rect-modifier 'super
   "Change the CUA rectangle modifier to this key."
   :type '(choice
@@ -470,19 +468,6 @@ bindings the keymap is:
           (when (featurep 'ergoemacs-menus)
             (ergoemacs-menus-off)))
         (ergoemacs-debug-heading "Ergoemacs Menus have loaded.")
-        (setq cua--rectangle-modifier-key ergoemacs-cua-rect-modifier)
-        (setq cua--rectangle-keymap (make-sparse-keymap))
-        (setq cua--rectangle-initialized nil)
-        (cua--init-rectangles)
-        (setq cua--keymap-alist
-              `((cua--ena-prefix-override-keymap . 
,cua--prefix-override-keymap)
-                (cua--ena-prefix-repeat-keymap . ,cua--prefix-repeat-keymap)
-                (cua--ena-cua-keys-keymap . ,cua--cua-keys-keymap)
-                (cua--ena-global-mark-keymap . ,cua--global-mark-keymap)
-                (cua--rectangle . ,cua--rectangle-keymap)
-                (cua--ena-region-keymap . ,cua--region-keymap)
-                (cua-mode . ,cua-global-keymap)))
-        
         (when (ergoemacs-real-key-binding [ergoemacs-single-command-keys])
           (if (not ergoemacs-read-key-overriding-overlay-save)
               (setq overriding-terminal-local-map 
ergoemacs-read-key-overriding-terminal-local-save)
@@ -512,20 +497,6 @@ bindings the keymap is:
           (set cm ergoemacs-old-ns-command-modifier))
         (when am
           (set am ergoemacs-old-ns-alternate-modifier))))
-    ;; Change retangle modifier back.    
-    (setq cua--rectangle-modifier-key ergoemacs-cua-rect-modifier-orig)
-    (setq cua--rectangle-modifier-key ergoemacs-cua-rect-modifier)
-    (setq cua--rectangle-keymap (make-sparse-keymap))
-    (setq cua--rectangle-initialized nil)
-    (cua--init-rectangles)
-    (setq cua--keymap-alist
-          `((cua--ena-prefix-override-keymap . ,cua--prefix-override-keymap)
-            (cua--ena-prefix-repeat-keymap . ,cua--prefix-repeat-keymap)
-            (cua--ena-cua-keys-keymap . ,cua--cua-keys-keymap)
-            (cua--ena-global-mark-keymap . ,cua--global-mark-keymap)
-            (cua--rectangle . ,cua--rectangle-keymap)
-            (cua--ena-region-keymap . ,cua--region-keymap)
-            (cua-mode . ,cua-global-keymap)))
     (remove-hook 'pre-command-hook 'ergoemacs-pre-command-hook)
     (ergoemacs-populate-pre-command-hook t)
     ;; Revert `substitute-command-keys' and `completing-read'



reply via email to

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