aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/signal-config.el10
-rw-r--r--tests/test-signal-config.el10
2 files changed, 16 insertions, 4 deletions
diff --git a/modules/signal-config.el b/modules/signal-config.el
index 102ece86f..317e35203 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
diff --git a/tests/test-signal-config.el b/tests/test-signal-config.el
index 3be63362d..7556efdbe 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 ()