From 2f9bad50132d0278c5581934c4bc54cd10244399 Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Sun, 8 Sep 2019 17:19:15 +0100 Subject: [PATCH] Switching `` to `` The idea behind this change is that my X230 doesn't have easy access to a `Menu` key. Furthermore, while it is possible for me to remap a different key (say CAPSLOCK) to `Menu`, it also adds the problem if stray control characters when hitting it outside of emacs. This has shown to be a problem quite frequently, which has resulted in me not being able to use many of the `Menu` modified combinations in ergoemacs. While I experimented around replacing X input events via an external tool [1], the easier solution to this problem is to not use `Menu` as a modifier for ergoemacs. Unfortunately this is not a tweakable variable that I can adjust in my emacs configuration, but instead needed to patch (thus this patch). My regular emacs config [2] has no knowledge of this change, neither will yours. Instead of using `Menu`, the `Hyper` key is introduced to the keyboard layout. The rationale behind `Hyper` is that it is a modifier that is otherwise not present on most keyboards, and also doesn't add a stray control character when pressed outside of emacs. --- ergoemacs-mode.el | 2 +- ergoemacs-test.el | 20 +++--- ergoemacs-themes.el | 98 +++++++++++++++--------------- ergoemacs-translate.el | 2 +- kbd-ergo.html | 6 +- o-blog-template/style/js/keymap.js | 4 +- web.org | 6 +- 7 files changed, 69 insertions(+), 69 deletions(-) diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el index 5b18155..1126414 100644 --- a/ergoemacs-mode.el +++ b/ergoemacs-mode.el @@ -1189,7 +1189,7 @@ color. Otherwise this will be nil A color string as passed to "" "" "" - "" "" + "" "" "RET" "ESC" "DEL" "TAB" "" "" diff --git a/ergoemacs-test.el b/ergoemacs-test.el index c62330a..34b98eb 100644 --- a/ergoemacs-test.el +++ b/ergoemacs-test.el @@ -988,7 +988,7 @@ Should test issue #142" nil (if (eq system-type 'windows-nt) " m c" - " m c") nil nil "") t))) + " m c") nil nil "") t))) (ert-deftest ergoemacs-test-global-key-set-apps-m-c-before-2 () "Test setting m c before loading (define-key)." @@ -999,7 +999,7 @@ Should test issue #142" nil (if (eq system-type 'windows-nt) " m c" - " m c") 'define-key nil "") t))) + " m c") 'define-key nil "") t))) (ert-deftest ergoemacs-test-global-key-set-m-semi-before () "Test setting M-; before loading." @@ -1020,7 +1020,7 @@ Should test issue #142" nil (if (eq system-type 'windows-nt) "" - "")) t))) + "")) t))) (ert-deftest ergoemacs-test-global-key-set-apps-before-2 () @@ -1032,7 +1032,7 @@ Should test issue #142" nil (if (eq system-type 'windows-nt) "" - "") 'define-key) t))) + "") 'define-key) t))) (ert-deftest ergoemacs-test-global-key-set-apps-m-before () "Test setting m before loading." @@ -1043,7 +1043,7 @@ Should test issue #142" nil (if (eq system-type 'windows-nt) " m" - " m") nil nil "") t))) + " m") nil nil "") t))) (ert-deftest ergoemacs-test-global-key-set-apps-m-before-2 () "Test setting m before loading (define-key)." @@ -1054,7 +1054,7 @@ Should test issue #142" nil (if (eq system-type 'windows-nt) " m" - " m") 'define-key nil "") t))) + " m") 'define-key nil "") t))) (ert-deftest ergoemacs-test-global-key-set-apps-m-after () "Test setting m after loading" @@ -1065,7 +1065,7 @@ Should test issue #142" 'after (if (eq system-type 'windows-nt) " m" - " m") nil nil "") t))) + " m") nil nil "") t))) (ert-deftest ergoemacs-test-global-key-set-apps-m-after-2 () @@ -1077,7 +1077,7 @@ Should test issue #142" 'after (if (eq system-type 'windows-nt) " m" - " m") 'define-key nil "") t))) + " m") 'define-key nil "") t))) (ert-deftest ergoemacs-test-global-key-set-apps-m-c-after () "Test setting m c after loading." @@ -1088,7 +1088,7 @@ Should test issue #142" 'after (if (eq system-type 'windows-nt) " m c" - " m c") nil nil "") t))) + " m c") nil nil "") t))) (ert-deftest ergoemacs-test-global-key-set-apps-m-c-after-2 () "Test setting m c after loading (define-key)." @@ -1099,7 +1099,7 @@ Should test issue #142" 'after (if (eq system-type 'windows-nt) " m c" - " m c") 'define-key nil "") t))) + " m c") 'define-key nil "") t))) (ert-deftest ergoemacs-test-global-key-set-after-220 () diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el index fdc7a13..6bfa074 100644 --- a/ergoemacs-themes.el +++ b/ergoemacs-themes.el @@ -1138,55 +1138,55 @@ (ergoemacs-component ergoemacs-banish-shift () "Banish Shift Combinations with SPC" :variable-reg "" - (global-set-key (kbd " SPC SPC") (kbd "_")) ;low line (underscore) - (global-set-key (kbd " SPC RET") (kbd "-")) - (global-set-key (kbd " SPC '") (kbd "\"")) - (global-set-key (kbd " SPC ,") (kbd "<")) - (global-set-key (kbd " SPC -") (kbd "_")) - (global-set-key (kbd " SPC .") (kbd ">")) - (global-set-key (kbd " SPC /") (kbd "?")) - (global-set-key (kbd " SPC ;") (kbd ":")) - (global-set-key (kbd " SPC =") (kbd "+")) - (global-set-key (kbd " SPC \\") (kbd "|")) - (global-set-key (kbd " SPC `") (kbd "~")) - - (global-set-key (kbd " SPC 0") (kbd ")")) - (global-set-key (kbd " SPC 1") (kbd "!")) - (global-set-key (kbd " SPC 2") (kbd "@")) - (global-set-key (kbd " SPC 3") (kbd "#")) - (global-set-key (kbd " SPC 4") (kbd "$")) - (global-set-key (kbd " SPC 5") (kbd "%")) - (global-set-key (kbd " SPC 6") (kbd "^")) - (global-set-key (kbd " SPC 7") (kbd "&")) - (global-set-key (kbd " SPC 8") (kbd "*")) - (global-set-key (kbd " SPC 9") (kbd "(")) - - (global-set-key (kbd " SPC a") (kbd "A")) - (global-set-key (kbd " SPC b") (kbd "B")) - (global-set-key (kbd " SPC c") (kbd "C")) - (global-set-key (kbd " SPC d") (kbd "D")) - (global-set-key (kbd " SPC e") (kbd "E")) - (global-set-key (kbd " SPC f") (kbd "F")) - (global-set-key (kbd " SPC g") (kbd "G")) - (global-set-key (kbd " SPC h") (kbd "H")) - (global-set-key (kbd " SPC i") (kbd "I")) - (global-set-key (kbd " SPC j") (kbd "J")) - (global-set-key (kbd " SPC k") (kbd "K")) - (global-set-key (kbd " SPC l") (kbd "L")) - (global-set-key (kbd " SPC m") (kbd "M")) - (global-set-key (kbd " SPC n") (kbd "N")) - (global-set-key (kbd " SPC o") (kbd "O")) - (global-set-key (kbd " SPC p") (kbd "P")) - (global-set-key (kbd " SPC q") (kbd "Q")) - (global-set-key (kbd " SPC r") (kbd "R")) - (global-set-key (kbd " SPC s") (kbd "S")) - (global-set-key (kbd " SPC t") (kbd "T")) - (global-set-key (kbd " SPC u") (kbd "U")) - (global-set-key (kbd " SPC v") (kbd "V")) - (global-set-key (kbd " SPC w") (kbd "W")) - (global-set-key (kbd " SPC x") (kbd "X")) - (global-set-key (kbd " SPC y") (kbd "Y")) - (global-set-key (kbd " SPC z") (kbd "Z"))) + (global-set-key (kbd " SPC SPC") (kbd "_")) ;low line (underscore) + (global-set-key (kbd " SPC RET") (kbd "-")) + (global-set-key (kbd " SPC '") (kbd "\"")) + (global-set-key (kbd " SPC ,") (kbd "<")) + (global-set-key (kbd " SPC -") (kbd "_")) + (global-set-key (kbd " SPC .") (kbd ">")) + (global-set-key (kbd " SPC /") (kbd "?")) + (global-set-key (kbd " SPC ;") (kbd ":")) + (global-set-key (kbd " SPC =") (kbd "+")) + (global-set-key (kbd " SPC \\") (kbd "|")) + (global-set-key (kbd " SPC `") (kbd "~")) + + (global-set-key (kbd " SPC 0") (kbd ")")) + (global-set-key (kbd " SPC 1") (kbd "!")) + (global-set-key (kbd " SPC 2") (kbd "@")) + (global-set-key (kbd " SPC 3") (kbd "#")) + (global-set-key (kbd " SPC 4") (kbd "$")) + (global-set-key (kbd " SPC 5") (kbd "%")) + (global-set-key (kbd " SPC 6") (kbd "^")) + (global-set-key (kbd " SPC 7") (kbd "&")) + (global-set-key (kbd " SPC 8") (kbd "*")) + (global-set-key (kbd " SPC 9") (kbd "(")) + + (global-set-key (kbd " SPC a") (kbd "A")) + (global-set-key (kbd " SPC b") (kbd "B")) + (global-set-key (kbd " SPC c") (kbd "C")) + (global-set-key (kbd " SPC d") (kbd "D")) + (global-set-key (kbd " SPC e") (kbd "E")) + (global-set-key (kbd " SPC f") (kbd "F")) + (global-set-key (kbd " SPC g") (kbd "G")) + (global-set-key (kbd " SPC h") (kbd "H")) + (global-set-key (kbd " SPC i") (kbd "I")) + (global-set-key (kbd " SPC j") (kbd "J")) + (global-set-key (kbd " SPC k") (kbd "K")) + (global-set-key (kbd " SPC l") (kbd "L")) + (global-set-key (kbd " SPC m") (kbd "M")) + (global-set-key (kbd " SPC n") (kbd "N")) + (global-set-key (kbd " SPC o") (kbd "O")) + (global-set-key (kbd " SPC p") (kbd "P")) + (global-set-key (kbd " SPC q") (kbd "Q")) + (global-set-key (kbd " SPC r") (kbd "R")) + (global-set-key (kbd " SPC s") (kbd "S")) + (global-set-key (kbd " SPC t") (kbd "T")) + (global-set-key (kbd " SPC u") (kbd "U")) + (global-set-key (kbd " SPC v") (kbd "V")) + (global-set-key (kbd " SPC w") (kbd "W")) + (global-set-key (kbd " SPC x") (kbd "X")) + (global-set-key (kbd " SPC y") (kbd "Y")) + (global-set-key (kbd " SPC z") (kbd "Z"))) (ergoemacs-component menu-bar-file () "File menu" diff --git a/ergoemacs-translate.el b/ergoemacs-translate.el index a3b9f88..997325b 100644 --- a/ergoemacs-translate.el +++ b/ergoemacs-translate.el @@ -313,7 +313,7 @@ variants are created using `ergoemacs-translate--apply-funs'." (defun ergoemacs-translate--define-key (keymap key def) "Similar to `define-key', with the following differences: - Both the Meta and escape sequences are bound. -- Both and key sequences are bound. +- Both and key sequences are bound. - `ergoemacs-mode' advice to `define-key' is supressed. KEYMAP is the keymap that will be used for the definition. diff --git a/kbd-ergo.html b/kbd-ergo.html index faf8ee8..13adc89 100644 --- a/kbd-ergo.html +++ b/kbd-ergo.html @@ -47,7 +47,7 @@ document.getElementById('canvas').innerHTML="This page is built with SVG jQuery } kbd_layout = ["", "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "", "", "", "q", "w", "f", "p", "g", "j", "l", "u", "y", ";", "[", "]", "\\", "", "", "a", "r", "s", "t", "d", "h", "n", "e", "i", "o", "'", "", "", "", "", "z", "x", "c", "v", "b", "k", "m", ",", ".", "\/", "", "", "", "", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "", "", "", "Q", "W", "F", "P", "G", "J", "L", "U", "Y", ":", "{", "}", "|", "", "", "A", "R", "S", "T", "D", "H", "N", "E", "I", "O", "\"", "", "", "", "", "Z", "X", "C", "V", "B", "K", "M", "<", ">", "?", "", "", ""]; -var_layout = {"M-n":"\u2190 char", "M-i":"\u2192 char", "M-u":"\u2191 line", "M-e":"\u2193 line", "M-C-n":"\u2190 word", "M-C-i":"\u2192 word", "M-C-u":"\u2191 \u00b6", "M-C-e":"\u2193 \u00b6", "M-l":"\u2190 word", "M-y":"\u2192 word", "M-L":"\u2190 \u00b6", "M-Y":"\u2192 \u00b6", "M-h":"\u2190 line\/*", "M-H":"\u2192 line\/*", "M-U":"\u2191 page", "M-E":"\u2193 page", "M-k":"\u2191 Top*", "M-K":"\u2193 Bottom*", "M-N":"\u2190 bracket", "M-I":"\u2192 bracket", "M-j":"\u2192 isearch", "M-J":"\u2190 isearch", "M-;":"recenter", "M-s":"\u232b char", "M-t":"\u2326 char", "M-f":"\u232b word", "M-p":"\u2326 word", "M-x":"\u2702 region", "M-c":"copy", "M-v":"paste", "M-V":"paste \u2191", "M-C":"copy all", "M-X":"\u2702 all", "M-Z":"\u21b7 redo", "M-z":"\u21b6 undo", "M-d":"\u2326 line", "M-D":"\u232b line", "M-S-SPC":"Mark Paragraph", "M-w":"\u2327 white", "M-'":"cmt dwim", "M-?":"tog. camel", "M-\/":"tog. case", "M-g":"\u21af compl", "M-G":"flyspell", "M-q":"fill\/unfill \u00b6", "":null, "M-SPC":"Set Mark", "M-a":"M-x", "M-A":"shell cmd", "M-r":"next pane", "M-R":"prev pane", "M-~":"prev frame", "M-`":"next frame", "M-5":"rep", "M-%":"rep reg", "M-3":"x other pane", "M-2":"x pane", "M-4":"split |", "M-$":"split \u2014", "M-8":"\u2190region\u2192", "M-*":"\u2190quote\u2192", "M-6":"Sel. Block", "M-7":"Sel. Line", "M-b":"Ace Jump", " 2":"x pane", " 3":"x other pane", " 4":"split \u2014", " 5":"rep", " ":"\u2702 all", " ":"copy all", " ":"M-x", " TAB":"indent-region", " SPC":"Set Mark", " a":"Sel All", " s":"Ctl-x", " t":"Ctl-c", " h":"Help", " h '":null, " h 1":null, " h 2":null, " h 3":null, " h 4":null, " h 5":null, " h 7":null, " h 8":null, " h 9":null, " h `":null, " h m":null, " h y":null, " h z":null, " h Z":null, " u":"Alt+Shift", " e":"Alt+mode", " m":"C-c C-c", " r":"Save", " y":"Open", " d":"C-u", " w":"Close", " x":"\u2702 region", " c":"copy", " v":"paste", " b":"\u21b7 redo", " g":"switch buf", " z":"\u21b6 undo", " k a":"agenda", " k A":"capture", " k c":"calc", " k d":"dired", " k e":"eshell", " k f":"OS Dir", " k g":"grep", " k m":"magit", " k o":"OS Open", " k r":"R", " k s":"shell", " k g":"capture", " k G":"agenda", " p":"Goto"}; +var_layout = {"M-n":"\u2190 char", "M-i":"\u2192 char", "M-u":"\u2191 line", "M-e":"\u2193 line", "M-C-n":"\u2190 word", "M-C-i":"\u2192 word", "M-C-u":"\u2191 \u00b6", "M-C-e":"\u2193 \u00b6", "M-l":"\u2190 word", "M-y":"\u2192 word", "M-L":"\u2190 \u00b6", "M-Y":"\u2192 \u00b6", "M-h":"\u2190 line\/*", "M-H":"\u2192 line\/*", "M-U":"\u2191 page", "M-E":"\u2193 page", "M-k":"\u2191 Top*", "M-K":"\u2193 Bottom*", "M-N":"\u2190 bracket", "M-I":"\u2192 bracket", "M-j":"\u2192 isearch", "M-J":"\u2190 isearch", "M-;":"recenter", "M-s":"\u232b char", "M-t":"\u2326 char", "M-f":"\u232b word", "M-p":"\u2326 word", "M-x":"\u2702 region", "M-c":"copy", "M-v":"paste", "M-V":"paste \u2191", "M-C":"copy all", "M-X":"\u2702 all", "M-Z":"\u21b7 redo", "M-z":"\u21b6 undo", "M-d":"\u2326 line", "M-D":"\u232b line", "M-S-SPC":"Mark Paragraph", "M-w":"\u2327 white", "M-'":"cmt dwim", "M-?":"tog. camel", "M-\/":"tog. case", "M-g":"\u21af compl", "M-G":"flyspell", "M-q":"fill\/unfill \u00b6", "":null, "M-SPC":"Set Mark", "M-a":"M-x", "M-A":"shell cmd", "M-r":"next pane", "M-R":"prev pane", "M-~":"prev frame", "M-`":"next frame", "M-5":"rep", "M-%":"rep reg", "M-3":"x other pane", "M-2":"x pane", "M-4":"split |", "M-$":"split \u2014", "M-8":"\u2190region\u2192", "M-*":"\u2190quote\u2192", "M-6":"Sel. Block", "M-7":"Sel. Line", "M-b":"Ace Jump", " 2":"x pane", " 3":"x other pane", " 4":"split \u2014", " 5":"rep", " ":"\u2702 all", " ":"copy all", " ":"M-x", " TAB":"indent-region", " SPC":"Set Mark", " a":"Sel All", " s":"Ctl-x", " t":"Ctl-c", " h":"Help", " h '":null, " h 1":null, " h 2":null, " h 3":null, " h 4":null, " h 5":null, " h 7":null, " h 8":null, " h 9":null, " h `":null, " h m":null, " h y":null, " h z":null, " h Z":null, " u":"Alt+Shift", " e":"Alt+mode", " m":"C-c C-c", " r":"Save", " y":"Open", " d":"C-u", " w":"Close", " x":"\u2702 region", " c":"copy", " v":"paste", " b":"\u21b7 redo", " g":"switch buf", " z":"\u21b6 undo", " k a":"agenda", " k A":"capture", " k c":"calc", " k d":"dired", " k e":"eshell", " k f":"OS Dir", " k g":"grep", " k m":"magit", " k o":"OS Open", " k r":"R", " k s":"shell", " k g":"capture", " k G":"agenda", " p":"Goto"}; fix_layout = {"":"\u21b6 undo", "":"\u21b6 undo", "C-z":"\u21b6 undo", "":"\u21b7 redo", "":"\u21b7 redo", "C-Z":"\u21b7 redo", "":null, " ":null, "":null, "":null, " ":null, "":"\u2702 region", "":"\u2702 region", "C-c ":null, "C-c":"Copy", "":"Copy", "":"\u2702 all", "":"Copy all", "":"paste \u2191", "C-V":"paste \u2191", "":"paste", "":"paste", "C-v":"paste", "C-N":"New Frame", "":"\u2326 char", "":"\u2326 word", "":"\u2326 word", "":"\u2190 line\/\u00b6", "":"\u2192 line\/\u00b6", "":"\u2191 Top", "":"\u2193 Bottom", "":"\u2190 word", "":"\u2192 word", "":"\u2192 \u00b6", "":"\u2192 \u00b6", "M-RET":"Newline & Indent", "C-r":"Revert", "":"tog. case", "":"\u2702 all", "":"Copy all", "":"\u00d7 Frame", "":null, "":null, "":null, "":null, "":null, "":"Previous", "":"Next", " '":null, " 1":null, " 2":null, " 3":null, " 4":null, " 5":null, " 7":null, " 8":null, " 9":null, " `":null, " m":null, " o":null, "":"copy", "":"Alt mode", "C-+":"+Font Size", "C--":"-Font Size", "C-.":"Quit", "C-\/":"Info", "C-0":null, "C-":null, "C-":null, "C-":null, "C-=":"+Font Size", "C-?":"Info", "C-S-":null, "C-S-":null, "C-C":"Copy", "C-F":"Occur", "C-O":"OS Open", "C-S":"Save As", "C-T":"Open Last", "C-W":"\u00d7 Frame", "C-X":"Cut", "C-`":"\u2194 Frame", "C-a":"Select all", "C-f":"Search", "C-h '":null, "C-h 1":null, "C-h 2":null, "C-h 3":null, "C-h 4":null, "C-h 5":null, "C-h 7":null, "C-h 8":null, "C-h 9":null, "C-h `":null, "C-h m":null, "C-h o":null, "C-l":"Goto", "C-n":"New Buffer", "C-o":"Edit File", "C-p":"Print", "C-s":"Save", "C-w":"Close Buf.", "C-x ":null, "C-x C-b":null, "C-x":"Cut", "C-y":"\u21b7 redo", "M-S-":null, "M-S-":null}; function getText(textType, textNumber){ var ret = " "; @@ -74,7 +74,7 @@ function getText(textType, textNumber){ } else { if (textType == "AA"){ - ret = " "; + ret = " "; } else if (textType == "CC"){ ret = "C-"; } else if (textType == "CS"){ @@ -110,7 +110,7 @@ function getText(textType, textNumber){ else if (textType == "M") ret = "M-" else if (textType == "A") - ret = " " + ret = " " ret = ret + kbd_layout[textNumber]; if (!(var_layout[ret] == undefined)){ ret = var_layout[ret] + ' '; diff --git a/o-blog-template/style/js/keymap.js b/o-blog-template/style/js/keymap.js index 2f0543f..2fba777 100644 --- a/o-blog-template/style/js/keymap.js +++ b/o-blog-template/style/js/keymap.js @@ -74,7 +74,7 @@ function getText(textType, textNumber){ } else { if (textType == "AA"){ - ret = " "; + ret = " "; } else if (textType == "CC"){ ret = "C-"; } else if (textType == "CS"){ @@ -110,7 +110,7 @@ function getText(textType, textNumber){ else if (textType == "M") ret = "M-" else if (textType == "A") - ret = " " + ret = " " ret = ret + kbd_layout[layout][textNumber]; if (var_layouts[theme] && !(var_layouts[theme][ret] == undefined)){ ret = var_layouts[theme][ret] + ' '; diff --git a/web.org b/web.org index 6553a9d..0278968 100644 --- a/web.org +++ b/web.org @@ -1729,7 +1729,7 @@ For your information, an "unchorded" filter/translation would translate: - Press Menu again to go back to the unchorded keyboard filter.* ** Ergoemacs Key Chord Reduction **** Movement without key-chords -***** Method #1 -- Movement mode +***** Method #1 -- Movement mode One can enable movement without key-chords as follows: - On QWERTY, press [Menu] [k] and then the movement key. This key is repeatable. Therefore [Menu] [k] [k] [k] would move the cursor down @@ -1822,7 +1822,7 @@ is done by: ~/.emacs.d/init.el) as follows: #+BEGIN_SRC emacs-lisp -(define-key key-translation-map (kbd "") (kbd "")) +(define-key key-translation-map (kbd "") (kbd "")) #+END_SRC *** Why don't you use the standard emacs key notation? @@ -1912,7 +1912,7 @@ Adding keys for moving around words and deleting words. file:ergoemacs-extras/lvl2/ergoemacs-layout-us.png **** Level 3 -Full ergoemacs keyset without the / unchorded keys. +Full ergoemacs keyset without the / unchorded keys. #+BEGIN_SRC emacs-lisp (setq ergoemacs-theme nil) (ergoemacs-theme-option-off '(apps apps-apps apps-punctuation apps-swap)) -- 2.22.0