aboutsummaryrefslogtreecommitdiff
path: root/modules/signal-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-28 02:45:31 -0500
committerCraig Jennings <c@cjennings.net>2026-05-28 02:45:31 -0500
commita00628ac96d5f09f96be868755304f7bdfdc0d99 (patch)
treee179087245e29f1cec66c28974cfe151185175a1 /modules/signal-config.el
parent0aa21f770f3908b4ec36ebee865498c3bd530dc7 (diff)
downloaddotemacs-a00628ac96d5f09f96be868755304f7bdfdc0d99.tar.gz
dotemacs-a00628ac96d5f09f96be868755304f7bdfdc0d99.zip
fix(signal): require signel before reading its private variables
cj/signel--ensure-started in modules/signal-config.el was reading signel--process-name in the first branch of its cond before the use-package autoload of signel had fired. The forward-declared (defvar signel--process-name) at L137 silences the byte-compile warning but doesn't actually bind the variable. Its value comes from signel.el's defconst, which doesn't run until signel is loaded. The first call to cj/signel-connect (C-; M SPC) after Emacs launch produced "Symbol's value as variable is void: signel--process-name" instead of starting the daemon. Surfaced tonight during the manual verify walk of the initiate-message workflow. I added (require 'signel) at the top of cj/signel--ensure-started so signel loads before any of its variables get read. The require is idempotent, so callers that hit the function after signel is already loaded pay nothing. The new ERT test test-signal-config-ensure-started-requires-signel-first asserts ordering: require must be the first call inside the function, not just called somewhere. A future refactor that moves the require below the cond would fail this test instead of passing silently.
Diffstat (limited to 'modules/signal-config.el')
-rw-r--r--modules/signal-config.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/signal-config.el b/modules/signal-config.el
index bed0f1e6..00279d4c 100644
--- a/modules/signal-config.el
+++ b/modules/signal-config.el
@@ -165,7 +165,14 @@ Three branches:
If startup launches but the RPC handshake exits before the first response,
the subsequent `signel--send-rpc' call (in the pre-warm or any later
fetch) signals through its own error path; check =*signel-log*= and
-=*signel-stderr*= for detail and link the account manually."
+=*signel-stderr*= for detail and link the account manually.
+
+Loads the `signel' feature explicitly before reading any of its
+private variables: the use-package above autoloads only on
+`signel-start' / `signel-stop' / `signel-chat' / `signel-dashboard',
+so without this require the first branch's read of `signel--process-name'
+fires a void-variable error before the autoload would trigger."
+ (require 'signel)
(cond
((process-live-p (get-process signel--process-name))
nil)