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

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

[elpa] externals/ergoemacs-mode e7a914b 094/325: Remove ctl-to-alt


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode e7a914b 094/325: Remove ctl-to-alt
Date: Sat, 23 Oct 2021 18:48:29 -0400 (EDT)

branch: externals/ergoemacs-mode
commit e7a914b03003895b2e457b6340ff4fe0cd031599
Author: Walter Landry <wlandry@caltech.edu>
Commit: Walter Landry <wlandry@caltech.edu>

    Remove ctl-to-alt
---
 ergoemacs-command-loop.el |  6 ++--
 ergoemacs-mode.el         |  7 +----
 ergoemacs-test.el         | 75 -----------------------------------------------
 ergoemacs-themes.el       | 39 ------------------------
 4 files changed, 4 insertions(+), 123 deletions(-)

diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index 959e4b4..16b4b13 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -246,7 +246,7 @@ This is called through `ergoemacs-command-loop'"
 This is called through `ergoemacs-command-loop'.
 
 TYPE is the keyboard translation type, defined by `ergoemacs-translate'.
-Ergoemacs-mode sets up: :ctl-to-alt :unchorded :normal."
+Ergoemacs-mode sets up: :unchorded :normal."
   (interactive)
   (let* ((char (if (integerp last-command-event)
                    last-command-event
@@ -263,7 +263,7 @@ Ergoemacs-mode sets up: :ctl-to-alt :unchorded :normal."
 This is called through `ergoemacs-command-loop'.
 
 TYPE is the keyboard translation type, defined by `ergoemacs-translate'
-Ergoemacs-mode sets up: :ctl-to-alt :unchorded :normal."
+Ergoemacs-mode sets up: :unchorded :normal."
   (setq current-prefix-arg '-)
   (ergoemacs-command-loop nil type nil t))
 
@@ -1586,7 +1586,7 @@ The KEY is the keyboard input where the reading begins.  
If nil,
 read the whole keymap.
 
 TYPE is the keyboard translation type, defined by `ergoemacs-translate'
-Ergoemacs-mode sets up: :ctl-to-alt :unchorded :normal.
+Ergoemacs-mode sets up: :unchorded :normal.
 
 INITIAL-KEY-TYPE represents the translation type for the initial KEY.
 
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index 76534a8..7e720ce 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -918,12 +918,7 @@ Valid values are:
 
 (defcustom ergoemacs-command-loop-swap-translation
   '(((:normal :normal) :unchorded-ctl)
-    ((:normal :unchorded-ctl) :ctl-to-alt)
-    ((:normal :unchorded-ctl) :normal)
-    ((:ctl-to-alt :ctl-to-alt) :unchorded-ctl)
-    ((:ctl-to-alt :unchorded-ctl) :ctl-to-alt)
-    ((:unchorded-ctl :unchorded-ctl) :ctl-to-alt)
-    ((:unchorded-ctl :ctl-to-alt) :unchorded-ctl))
+    ((:normal :unchorded-ctl) :normal))
   "How the translation will be swapped."
   :type '(repeat
           (list
diff --git a/ergoemacs-test.el b/ergoemacs-test.el
index ada68c4..1b9cad2 100644
--- a/ergoemacs-test.el
+++ b/ergoemacs-test.el
@@ -1299,81 +1299,6 @@ Tests Issue #372."
   :tags '(:translate)
   (should (equal ergoemacs-layout-us (ergoemacs-translate--quail-to-ergoemacs 
(ergoemacs-translate-layout 'us :quail)))))
 
-(ert-deftest ergoemacs-test-translations ()
-  "Test ergoemacs-mode translations"
-  :tags '(:translate)
-  (should (string= "A" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "A" t) 0))))))
-  (should (string= "M-A" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "C-S-a" t) 0) 
:ctl-to-alt)))))
-
-  ;; DEL = ^?, doesn't seem to have the issues that RET, ESC, and TAB has.
-  (should (string= "DEL" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "DEL" t) 0) 
:ctl-to-alt)))))
-  
-  (should (string= "C-DEL" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-DEL" t) 0) 
:ctl-to-alt)))))
-  
-  (should (string= "M-DEL" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "C-DEL" t) 0) 
:ctl-to-alt)))))
-
-  ;; RET = ^M
-  (should (string= "RET" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "RET" t) 0) 
:ctl-to-alt)))))
-
-  (should (string= "M-RET" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "C-RET" t) 0) 
:ctl-to-alt)))))
-
-  (should (string= "C-RET" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-RET" t) 0) 
:ctl-to-alt)))))
-
-  ;; ESC = ^[
-  (should (string= "ESC" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "ESC" t) 0) 
:ctl-to-alt)))))
-
-  (should (string= "C-ESC" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-ESC" t) 0) 
:ctl-to-alt)))))
-
-  (should (string= "M-ESC" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "C-ESC" t) 0) 
:ctl-to-alt)))))
-
-  ;; TAB = ^i
-  (should (string= "TAB" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "TAB" t) 0) 
:ctl-to-alt)))))
-
-  (should (string= "C-TAB" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-TAB" t) 0) 
:ctl-to-alt)))))
-  
-  (should (string= (key-description (kbd "M-TAB")) (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "C-TAB" t) 0) 
:ctl-to-alt)))))
-
-  (cl-letf (((symbol-function 'display-graphic-p) (lambda(&rest _ignore) t)))
-    ;; Test M-i -> ^i -> TAB
-    (should (string= "<C-i>" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-i" t) 0) 
:ctl-to-alt)))))
-    
-    ;; Test M-[ -> ^[ -> ESC
-    (should (string= "<C-[>" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-[" t) 0) 
:ctl-to-alt)))))
-    
-    ;; Test M-m -> ^m -> RET
-    (should (string= "<C-m>" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-m" t) 0) 
:ctl-to-alt))))))
-
-  (cl-letf (((symbol-function 'display-graphic-p) (lambda(&rest _ignore) nil)))
-    ;; Test M-i -> ^i -> TAB
-    (should (string= "TAB" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-i" t) 0) 
:ctl-to-alt)))))
-    
-    ;; Test M-[ -> ^[ -> ESC
-    (should (string= "ESC" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-[" t) 0) 
:ctl-to-alt)))))
-    
-    ;; Test M-m -> ^m -> RET
-    (should (string= "RET" (key-description (vector 
(ergoemacs-translate--event-mods (elt (read-kbd-macro "M-m" t) 0) 
:ctl-to-alt)))))))
-
-(ert-deftest ergoemacs-test-input-methods ()
-  "Make sure that `ergoemacs-mode' works with input methods."
-  :tags '(:translate)
-  (ergoemacs-test-layout
-   :layout "colemak"
-   :macro "arst"
-   (save-excursion
-     (switch-to-buffer (get-buffer-create "*ergoemacs-test*"))
-     (delete-region (point-min) (point-max))
-     (set-input-method "greek")
-     (message "%s" current-input-method)
-     (ergoemacs-command-loop--internal "arst")
-     (should (string= "αρστ" (buffer-string)))
-     (quail-set-keyboard-layout "colemak")
-     (delete-region (point-min) (point-max))
-     (ergoemacs-command-loop--internal "arst")
-     (quail-set-keyboard-layout "standard")
-     (should (string= "ασδφ" (buffer-string)))
-     (set-input-method nil)
-     (kill-buffer (current-buffer)))))
-
 (ert-deftest ergoemacs-test-translate-bound ()
   "Make sure that bound keys are put in the `ergoemacs-map--'
 hash appropriaetly."
diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el
index 63cc787..9c53de9 100644
--- a/ergoemacs-themes.el
+++ b/ergoemacs-themes.el
@@ -1359,43 +1359,4 @@
             (define-key map (read-kbd-macro "C-h") 'ergoemacs-read-key-help)
             map))
 
-(ergoemacs-translation ctl-to-alt ()
-  "Ctl <-> Alt translation"
-  :text (lambda() (format "<Ctl%sAlt> " (ergoemacs :unicode-or-alt "↔" " to 
")))
-  
-  :meta '(control)
-  :control '(meta)
-  
-  :meta-shift '(control shift)
-  :control-shift '(meta shift)
-  
-  :control-hyper '(meta hyper)
-  :meta-hyper '(control hyper)
-
-  :control-super '(meta super)
-  :meta-super '(control super)
-
-  :meta-shift-hyper '(control shift hyper)
-  :control-shift-hyper '(meta shift hyper)
-
-  :meta-shift-super '(control shift super)
-  :control-shift-super '(meta shift super)
-
-  :meta-super-hyper '(control super hyper)
-  :control-super-hyper '(meta super hyper)
-
-  :meta-super-hyper-shift '(control super hyper shift)
-  :control-super-hyper-shift '(meta super hyper shift)
-  
-  :modal-color "blue"
-  :modal-always t
-  
-  :keymap (let ((map (make-sparse-keymap)))
-            (define-key map [f1] 'ergoemacs-read-key-help)
-            (define-key map (read-kbd-macro "M-h") 'ergoemacs-read-key-help)
-            (define-key map (if (eq system-type 'windows-nt) [M-apps] 
[M-menu]) 'ergoemacs-read-key-force-next-key-is-quoted)
-            (define-key map (read-kbd-macro "SPC") 
'ergoemacs-read-key-force-next-key-is-ctl)
-            (define-key map (read-kbd-macro "M-SPC") 
'ergoemacs-read-key-force-next-key-is-alt)
-            map))
-
 (provide 'ergoemacs-themes)



reply via email to

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