aboutsummaryrefslogtreecommitdiff
path: root/modules
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
commit2c11d1a45c9d5b33fe2142a10b1c3d6f26b306c8 (patch)
tree74562b4dcfef9df69bb90ef312f3969ef7aeb3da /modules
parentf3e9405c6607ae6f2738ec4c973ce2776a519635 (diff)
downloaddotemacs-2c11d1a45c9d5b33fe2142a10b1c3d6f26b306c8.tar.gz
dotemacs-2c11d1a45c9d5b33fe2142a10b1c3d6f26b306c8.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')
-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 bed0f1e65..00279d4c8 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)