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. --- modules/signal-config.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/signal-config.el b/modules/signal-config.el index 102ece86..317e3520 100644 --- a/modules/signal-config.el +++ b/modules/signal-config.el @@ -16,6 +16,7 @@ ;;; Code: (require 'seq) +(require 'keybindings) ;; provides cj/custom-keymap + cj/register-prefix-map (defun cj/signal--jstr (value) "Return VALUE if it is a non-blank string, else nil. @@ -291,10 +292,11 @@ that on first use." Leaves =l= unbound for now -- the future =cj/signel-link= command lands in a later pass. See =docs/design/signal-client.org= scope summary.") -(declare-function cj/custom-keymap "keybindings" ()) -(with-eval-after-load 'keybindings - (when (boundp 'cj/custom-keymap) - (keymap-set cj/custom-keymap "M" cj/signel-prefix-map))) +;; Register the messages prefix under C-; M via the documented helper. +;; keybindings.el owns cj/custom-keymap; the (require 'keybindings) above +;; guarantees it is loaded before this runs, so no load-order guard is +;; needed. This is the same pattern every other feature module uses. +(cj/register-prefix-map "M" cj/signel-prefix-map "signal messages") (provide 'signal-config) ;;; signal-config.el ends here -- cgit v1.2.3