diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-16 09:41:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-16 09:41:58 -0500 |
| commit | bd35c3a74bfa329907f4ab15628197dd39e76c65 (patch) | |
| tree | 4d7023e756caea5130d137c2e40c6e0cdac775a0 /tests | |
| parent | 92538504f829ca49643ed0212e0af823cce9167a (diff) | |
| download | dotemacs-bd35c3a74bfa329907f4ab15628197dd39e76c65.tar.gz dotemacs-bd35c3a74bfa329907f4ab15628197dd39e76c65.zip | |
feat(keybindings): mirror the C-; command family under C-c ;
C-; is GUI-only: terminals can't encode Control-semicolon, so the whole custom command family (calendar, AI, Slack, org, pearl, jump, and the rest) was unreachable in a terminal frame (emacs -nw, emacsclient -nw, or Emacs inside vterm/tmux). I bound the single cj/custom-keymap under C-c ; alongside C-;, so the same leaf keys reach the identical map in both GUI and TTY with no relearning and no per-module edits. C-c is the standard user prefix and always TTY-encodable. I audited every leaf key in the family and they're all TTY-safe (letters, digits, punctuation, SPC, and arrow keys), so nothing needed remapping.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-keybindings-tty-mirror.el | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/test-keybindings-tty-mirror.el b/tests/test-keybindings-tty-mirror.el new file mode 100644 index 000000000..f63024c0b --- /dev/null +++ b/tests/test-keybindings-tty-mirror.el @@ -0,0 +1,33 @@ +;;; test-keybindings-tty-mirror.el --- TTY mirror prefix for the C-; family -*- lexical-binding: t; -*- + +;;; Commentary: +;; The personal prefix C-; is GUI-only — terminals can't encode Control-semicolon, +;; so the whole custom command family is unreachable in a TTY frame (emacs -nw, +;; emacsclient -nw, Emacs inside vterm/tmux). keybindings.el binds the single +;; `cj/custom-keymap' under a TTY-safe mirror prefix C-c ; alongside C-;, so the +;; same leaf keys reach the identical map in both GUI and terminal. These tests +;; pin that load-time global binding. + +;;; Code: + +(require 'ert) + +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'keybindings) + +(ert-deftest test-keybindings-tty-mirror-gui-prefix-resolves () + "Normal: the GUI prefix C-; resolves to cj/custom-keymap globally." + (should (eq (keymap-lookup (current-global-map) "C-;") cj/custom-keymap))) + +(ert-deftest test-keybindings-tty-mirror-tty-prefix-resolves () + "Normal: the TTY mirror C-c ; resolves to the same cj/custom-keymap." + (should (eq (keymap-lookup (current-global-map) "C-c ;") cj/custom-keymap))) + +(ert-deftest test-keybindings-tty-mirror-both-prefixes-share-one-map () + "Boundary: both prefixes point at the identical keymap object, so a leaf +key registered once is reachable under either prefix." + (should (eq (keymap-lookup (current-global-map) "C-;") + (keymap-lookup (current-global-map) "C-c ;")))) + +(provide 'test-keybindings-tty-mirror) +;;; test-keybindings-tty-mirror.el ends here |
