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

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

[elpa] externals/ergoemacs-mode 2ae2ebf 294/325: Remove command loop


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode 2ae2ebf 294/325: Remove command loop
Date: Sat, 23 Oct 2021 18:49:14 -0400 (EDT)

branch: externals/ergoemacs-mode
commit 2ae2ebfd799c5c9b4fa10f3e2797ebf6ed25851b
Author: Matthew Fidler <514778+mattfidler@users.noreply.github.com>
Commit: Matthew Fidler <514778+mattfidler@users.noreply.github.com>

    Remove command loop
---
 ergoemacs-command-loop.el | 35 -----------------------------------
 ergoemacs-mode.el         | 24 +-----------------------
 2 files changed, 1 insertion(+), 58 deletions(-)

diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index ce77486..e7c87e8 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -853,23 +853,6 @@ KEYS is the keys information"
          trans
          keys)))
 
-(defvar erogemacs-command--cua-timer nil)
-
-(defvar ergoemacs-command--cua-key-codes
-  (list (nth 0 (listify-key-sequence (kbd "C-c")))
-        (nth 0 (listify-key-sequence (kbd "C-x"))))
-  "Key codes to check against for C-c and C-x")
-
-(defun ergoemacs-command--dispach-cua ()
-  "Dispatches the CUA C-x and C-c."
-  (when (and ergoemacs-mode-cua-mode)
-    (let ((keys (this-single-command-keys)))
-      (when (and (= 1 (length keys))
-                 (memq (aref keys 0) ergoemacs-command--cua-key-codes)
-                 mark-active)
-        (setq unread-command-events (cons 'ergoemacs-timeout 
unread-command-events))
-        (ergoemacs-command--cua-timer-off)))))
-
 (defvar erogemacs-command--echo-timer nil)
 (defvar ergoemacs-command--blink-on nil)
 (defvar ergoemacs-orig-echo-keystrokes nil)
@@ -877,24 +860,6 @@ KEYS is the keys information"
 (defvar ergoemacs-command--timeout-timer nil)
 (defvar ergoemacs-command--timeout-keys nil)
 
-(defvar erogemacs-command--cua-timer nil)
-
-(defun ergoemacs-command--cua-timer-on ()
-  "Turn on the cua timer."
-  (if (and mark-active ergoemacs-mode-cua-mode)
-      (ergoemacs-command--cua-timer-off)
-      (setq erogemacs-command--cua-timer
-            (run-at-time t ergoemacs-command-loop-blink-rate 
#'ergoemacs-command--dispach-cua))))
-
-(defun ergoemacs-command--cua-timer-off ()
-  "Turn off the  cua timer."
-  (when (timerp erogemacs-command--cua-timer)
-    (cancel-timer erogemacs-command--cua-timer)))
-
-
-(add-hook 'ergoemacs-post-command-hook #'ergoemacs-command--cua-timer-on)
-(add-hook 'ergoemacs-shutdown-hook #'ergoemacs-command--cua-timer-off)
-
 (defvar ergoemacs-this-command-keys-shift-translated nil
   "ergoemacs override of shift translation in command loop.")
 
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index e2aa2ee..e522142 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -403,29 +403,12 @@ after initializing ergoemacs-mode.
                                        map)
   "The keybinding that is active when the mark is active.")
 
-
-(defcustom ergoemacs-mode-cua-mode t
-  "Use C-c and C-v for copy paste when mark is active."
-  :type 'boolean
-  :group 'ergoemacs-mode)
-
-
-(defvar ergoemacs-mark-active-cua-keymap (let ((map (make-sparse-keymap)))
-                                           (define-key map (kbd "C-c 
<ergoemacs-timeout>") 'ergoemacs-copy-line-or-region)
-                                           (define-key map (kbd "C-x 
<ergoemacs-timeout>") 'ergoemacs-cut-line-or-region)
-                                           map)
-  "The keybinding that is active when the mark is active.")
-
-
 (defvar ergoemacs-override-alist nil
   "ErgoEmacs override keymaps.")
 
 (defvar ergoemacs-minor-alist nil
   "ErgoEmacs minor mode keymap.")
 
-(defvar ergoemacs-minor-cua-alist nil
-  "ErgoEmacs cua mode keymap.")
-
 (declare-function ergoemacs-advice-undefined "ergoemacs-advice")
 
 (defun ergoemacs-setup-override-keymap ()
@@ -433,12 +416,9 @@ after initializing ergoemacs-mode.
   (setq ergoemacs-override-alist `((ergoemacs-mode . ,ergoemacs-user-keymap)
                                    (ergoemacs-mode . 
,ergoemacs-override-keymap)
                                    (ergoemacs-mode . ,ergoemacs-keymap))
-        ergoemacs-minor-alist `(mark-active . ,ergoemacs-mark-active-keymap)
-        ergoemacs-minor-cua-alist `(mark-active . 
,ergoemacs-mark-active-cua-keymap))
+        ergoemacs-minor-alist `(mark-active . ,ergoemacs-mark-active-keymap))
   (add-hook 'emulation-mode-map-alists ergoemacs-override-alist)
   (add-hook 'minor-mode-map-alist ergoemacs-minor-alist)
-  (when ergoemacs-mode-cua-mode
-    (add-hook 'minor-mode-map-alist ergoemacs-minor-cua-alist))
   (advice-add 'undefined :around #'ergoemacs-advice-undefined)
   (advice-add 'read-key :before #'ergoemacs-advice-read-key))
 
@@ -446,8 +426,6 @@ after initializing ergoemacs-mode.
   "Remove `ergoemacs-mode' keymaps."
   (remove-hook 'emulation-mode-map-alists 'ergoemacs-override-alist)
   (remove-hook 'minor-mode-map-alist ergoemacs-minor-alist)
-  (when ergoemacs-mode-cua-mode
-    (remove-hook 'minor-mode-map-alist ergoemacs-minor-cua-alist))
   (advice-remove 'undefined #'ergoemacs-advice-undefined)
   (advice-remove 'read-key #'ergoemacs-advice-read-key))
 



reply via email to

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