[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ergoemacs-mode bed9aa1 253/325: Fix ergoemacs-mode and
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ergoemacs-mode bed9aa1 253/325: Fix ergoemacs-mode and ergoemacs-themes; turn on cua mode |
Date: |
Sat, 23 Oct 2021 18:49:05 -0400 (EDT) |
branch: externals/ergoemacs-mode
commit bed9aa13107ed09a59f4322aade04defbd5fd58f
Author: Matthew Fidler <514778+mattfidler@users.noreply.github.com>
Commit: Matthew Fidler <514778+mattfidler@users.noreply.github.com>
Fix ergoemacs-mode and ergoemacs-themes; turn on cua mode
---
ergoemacs-mode.el | 14 ++++++++++++--
ergoemacs-themes.el | 26 ++++++++++++++++----------
2 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index f50a4fe..074be73 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -290,6 +290,8 @@ variable `ergoemacs-after-load-functions'."
(defvar ergoemacs-mode--default-frame-alist nil
"List that saves default frame parameters.")
+(defvar isearch-mode-map-ergoemacs nil
+ "This variable saves the variable `isearch-mode-map'.")
(defvar ergoemacs-mode--start-p nil
"Determines if `ergoemacs-mode' will start.")
@@ -347,7 +349,8 @@ The `execute-extended-command' is now
\\[execute-extended-command].
;;(global-unset-key (kbd "<menu>"))
;;(define-key ergoemacs-translate--parent-map [apps]
'ergoemacs-command-loop--swap-translation)
;;(define-key ergoemacs-translate--parent-map [menu]
'ergoemacs-command-loop--swap-translation)
-
+ (when ergoemacs-mode-turn-on-cua-mode
+ (cua-mode 1))
(if refresh-p
(message "Ergoemacs-mode keys refreshed (%s)"
ergoemacs-keyboard-layout)
@@ -362,7 +365,9 @@ The `execute-extended-command' is now
\\[execute-extended-command].
(remove-hook 'post-command-hook #'ergoemacs-post-command-hook)
(remove-hook 'pre-command-hook #'ergoemacs-pre-command-hook)
(remove-hook 'after-load-functions #'ergoemacs-after-load-functions)
-
+ (when ergoemacs-mode-turn-on-cua-mode
+ (cua-mode 0))
+ (setq isearch-mode-map (copy-keymap isearch-mode-map-ergoemacs))
(unless refresh-p
(message "Ergoemacs-mode turned OFF."))))
(setq ergoemacs-mode-started-p t))
@@ -645,6 +650,11 @@ When STORE-P is non-nil, save the tables."
"Spinners for long commands with `ergoemacs-command-loop'."
:group 'ergoemacs-command-loop)
+(defcustom ergoemacs-mode-turn-on-cua-mode t
+ "Turn on cua mode when starting `ergoemacs-mode'."
+ :type 'boolean
+ :group 'ergoemacs-mode)
+
(defcustom ergoemacs-command-loop-spinner (or (and
ergoemacs-use-unicode-symbols 'dots) 'standard)
"What spinner to use for long commands with `ergoemacs-command-loop'."
:type 'sexp
diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el
index 2f2b48b..a046a76 100644
--- a/ergoemacs-themes.el
+++ b/ergoemacs-themes.el
@@ -74,7 +74,7 @@ EXTRA-KEYS are untranslated keys that are appended."
(vconcat (listify-key-sequence key)))
command)))
-(defun ergoemacs-unset-keys-in-map (local-map)
+(defun ergoemacs-unset-keys-in-map (local-map-symbol)
"Unset all of the keys in a LOCAL-MAP.
This unsets the keys that we usually prefer to use the ergoemacs keys.
@@ -82,8 +82,12 @@ This unsets the keys that we usually prefer to use the
ergoemacs keys.
This currently is only used for `isearch-mode-map',
since that is the only map that manages to evade being overridden
by the emulation map."
- (ergoemacs-define-key local-map (kbd "M-h") nil)
- (ergoemacs-define-key local-map (kbd "M-H") nil)
+ (unless (intern-soft (concat (symbol-name local-map-symbol) "-ergoemacs"))
+ (set (intern (concat (symbol-name local-map-symbol) "-ergoemacs"))
+ (copy-keymap (symbol-value local-map-symbol))))
+ (let ((local-map (symbol-value local-map-symbol)))
+ (ergoemacs-define-key local-map (kbd "M-h") nil)
+ (ergoemacs-define-key local-map (kbd "M-H") nil)
(ergoemacs-define-key local-map (kbd "M-e") nil)
(ergoemacs-define-key local-map (kbd "M-r") nil)
@@ -168,7 +172,7 @@ by the emulation map."
(define-key local-map (kbd "C-S-o") nil)
(define-key local-map (kbd "C-r") nil)
(define-key local-map (kbd "C-p") nil)
- (define-key local-map (kbd "C-l") nil))
+ (define-key local-map (kbd "C-l") nil)))
(defun ergoemacs-set-standard-vars ()
"Enabled/changed variables/modes."
@@ -265,8 +269,7 @@ by the emulation map."
(add-hook 'kill-buffer-hook 'ergoemacs-save-buffer-to-recently-closed)
(add-hook 'shell-mode-hook 'ergoemacs-shell-here-hook)
(add-hook 'eshell-post-command-hook
'ergoemacs-shell-here-directory-change-hook)
- (delete-selection-mode 1)
- )
+ (delete-selection-mode 1))
(defun ergoemacs-unset-keys ()
"Unset all of the standard keys at once.
@@ -494,7 +497,6 @@ These keys do not depend on the layout."
;; (vconcat (listify-key-sequence (kbd "M-;")))
;; )
;; )
- ;; (ergoemacs-define-key isearch-mode-map (kbd "M-:")
'isearch-repeat-backward)
;; (put 'isearch-repeat-backward
;; :advertised-binding (ergoemacs-translate--event-layout
;; (vconcat (listify-key-sequence (kbd "M-:")))
@@ -506,7 +508,7 @@ These keys do not depend on the layout."
;; Ergoemacs does not have a generic "edit this" function. So I
;; used C-x C-q, since that is used to make uneditable things
;; editable.
- ;; (define-key isearch-mode-map (kbd "C-x C-q") 'isearch-edit-string)
+ ;;
;; When editing a search in isearch, it uses the
;; minibuffer-local-isearch-map keymap, which gets overridden by the
@@ -729,7 +731,9 @@ These keys do not depend on the layout."
(global-set-key [remap powershell] 'ergoemacs-powershell-here)
(global-set-key [remap shell] 'ergoemacs-shell-here)
(global-set-key [remap describe-mode]
- 'ergoemacs-describe-major-mode))
+ 'ergoemacs-describe-major-mode)
+ (global-set-key [remap cua-paste] 'ergoemacs-paste)
+ (global-set-key [remap cua-cut-region] 'ergoemacs-cut-line-or-region))
(defun ergoemacs-set-menu-bar-file ()
"File menu."
@@ -1293,7 +1297,9 @@ In a terminal, this can be either arrow keys (e.g. meta+O
A == <up>) or regular
(defun ergoemacs-install-isearch-mode ()
"Installs keys for isearch mode."
- (ergoemacs-unset-keys-in-map isearch-mode-map)
+ (ergoemacs-unset-keys-in-map 'isearch-mode-map)
+ (define-key isearch-mode-map (kbd "C-x C-q") 'isearch-edit-string)
+ (define-key isearch-mode-map (kbd "<f2>") 'isearch-edit-string)
;; Mode specific changes
;; (ergoemacs-define-key isearch-mode-map (kbd "M-d") 'isearch-delete-char)
- [elpa] externals/ergoemacs-mode 78bd8cf 231/325: Remove component stuff, (continued)
- [elpa] externals/ergoemacs-mode 78bd8cf 231/325: Remove component stuff, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d10087f 238/325: Remove ergoemacs macro :reset and :set-selection, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 2caaef6 239/325: Remove unused functions, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 4461083 242/325: Add reduction theme again, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 97a2107 243/325: Add back the command loop. Part of it seems broken, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 33cc2d6 244/325: Fix command loop key decriptions, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode ef2c71a 245/325: Add back the advices to have the ctrl/alt keys, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d9b09be 246/325: Make command loop play with unicode only, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode efc8751 249/325: Some fixes based on emacs elpa requirements, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 69abf8d 250/325: Fix ergoemacs-calculate-bindings, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode bed9aa1 253/325: Fix ergoemacs-mode and ergoemacs-themes; turn on cua mode,
Stefan Monnier <=
- [elpa] externals/ergoemacs-mode 57e8e17 257/325: remove undo-tree and mark-active, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode edc154f 272/325: Add theme for the ergoemacs keys hash. Also reduce tests, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 09bc371 278/325: Restore menu items after turning off ergoemacs, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode f14b71e 281/325: Remove ergoemacs-mode support for term-mode, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode f3ebfc1 298/325: Add input-pending-p to echoing of commands, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 349d05a 300/325: Remove describe theme, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 00e00a6 230/325: Remove ergoemacs-component-struct, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 37fc1c8 233/325: Remove ergoemacs-theme-component--parse, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 6f703fe 235/325: Remove ergoemacs-advice, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d0004ec 241/325: Remove more -map functions, Stefan Monnier, 2021/10/23