From 0946c42f5caaf715786780b7be8205e6ac289d8a Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 6 Jun 2026 12:32:59 -0500 Subject: fix(signal): register C-; M prefix via canonical helper The C-; M Signal prefix didn't take effect on a fresh Emacs launch. signal-config.el was the only feature module that bound into cj/custom-keymap directly, wrapped in (with-eval-after-load 'keybindings (when (boundp 'cj/custom-keymap) ...)). The boundp guard turned a load-order miss into a silent no-op, so the binding never landed at startup. A later live-reload always papered over it because keybindings was loaded by then. I switched to the documented cj/register-prefix-map helper and added (require 'keybindings) at the top, matching every other prefix map. The require guarantees keybindings loads before registration, so the guard is gone. I verified at a full emacs --batch init.el launch, the actual failing scenario, that C-; M resolves to the signel prefix. I added a contract test asserting the registration, since the boundp guard was robust under unit timings and only failed at full launch. --- tests/test-signal-config.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/test-signal-config.el b/tests/test-signal-config.el index 3be63362..7556efdb 100644 --- a/tests/test-signal-config.el +++ b/tests/test-signal-config.el @@ -368,6 +368,16 @@ commands the workflow spec names." (should (eq (keymap-lookup cj/signel-prefix-map "SPC") #'cj/signel-connect))) +(ert-deftest test-signal-config-prefix-map-registered-under-c-semi-m () + "Normal: loading signal-config registers `cj/signel-prefix-map' under +`M' in `cj/custom-keymap', so C-; M reaches the signel prefix. Guards +the wiring contract that the load-order bug broke: signal-config must +register through `cj/register-prefix-map', not a boundp-guarded direct +mutation that silently no-ops when keybindings loaded in a different +order." + (require 'keybindings) + (should (eq (keymap-lookup cj/custom-keymap "M") cj/signel-prefix-map))) + ;;; display-buffer-alist entry for *Signel: ...* chat buffers (ert-deftest test-signal-config-chat-buffer-display-rule-uses-bottom-30 () -- cgit v1.2.3