[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'
- [elpa] 169/287: Declare ergoemacs-read-key-default, (continued)
- [elpa] 169/287: Declare ergoemacs-read-key-default, Matthew Fidler, 2014/07/02
- [elpa] 171/287: Change define-function to autoload, Matthew Fidler, 2014/07/02
- [elpa] 172/287: Make this a emacs 24.4 autoload only, Matthew Fidler, 2014/07/02
- [elpa] 173/287: Non-conditional autoload at the beginning of the file., Matthew Fidler, 2014/07/02
- [elpa] 176/287: Fix Issue #231, Matthew Fidler, 2014/07/02
- [elpa] 175/287: Change the `describe-mode` to `ergoemacs-describe-major-mode`. That way R will display the correct key to view information (C-h m), Matthew Fidler, 2014/07/02
- [elpa] 178/287: Add ergoemacs-read-key-default to ergoemacs-smart-functions, Matthew Fidler, 2014/07/02
- [elpa] 174/287: Remove adjoin issues in 24.1 and 24.2, Matthew Fidler, 2014/07/02
- [elpa] 179/287: Fix ergoemacs-repeat-movement-commands, Matthew Fidler, 2014/07/02
- [elpa] 181/287: Added `ergoemacs-hook-functions`, Matthew Fidler, 2014/07/02
- [elpa] 177/287: Remove cua-mode treatment in startup,
Matthew Fidler <=
- [elpa] 180/287: Remap universal-argument to ergoemacs-universal-argument, Matthew Fidler, 2014/07/02
- [elpa] 182/287: Add package-requires for emacs 24.1, Matthew Fidler, 2014/07/02
- [elpa] 183/287: Split out ert, Matthew Fidler, 2014/07/02
- [elpa] 185/287: Bug fix for ergoemacs-substitute-command., Matthew Fidler, 2014/07/02
- [elpa] 184/287: Now use ergoemacs-pretty-key to describe fn keys, Matthew Fidler, 2014/07/02
- [elpa] 186/287: Fix ergoemacs-read-key-lookup-get-ret---universal, Matthew Fidler, 2014/07/02
- [elpa] 189/287: Do all tests, Matthew Fidler, 2014/07/02
- [elpa] 188/287: Fix some byte-compile issues, Matthew Fidler, 2014/07/02
- [elpa] 190/287: Fix Issue #233, Matthew Fidler, 2014/07/02
- [elpa] 193/287: Fix Issue #241, Matthew Fidler, 2014/07/02