From bd35c3a74bfa329907f4ab15628197dd39e76c65 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 16 Jun 2026 09:41:58 -0500 Subject: 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. --- tests/test-keybindings-tty-mirror.el | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/test-keybindings-tty-mirror.el (limited to 'tests') 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 -- cgit v1.2.3