<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-system-commands-resolve-and-run.el, branch load-graph-classify-start</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-start</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-start'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-24T09:15:30+00:00</updated>
<entry>
<title>fix(system-commands): make Emacs restart and destructive confirms defensive</title>
<updated>2026-05-24T09:15:30+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-24T09:15:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=f1dbec16531cd3d5f0b9124accedb8cb8e49dea3'/>
<id>urn:sha1:f1dbec16531cd3d5f0b9124accedb8cb8e49dea3</id>
<content type='text'>
Restart-Emacs scheduled an unconditional kill-emacs one second after firing the systemctl restart. If the service was missing or the restart failed, the session still got killed with nothing to replace it. Restart now guards on (daemonp) and a present emacs.service before doing anything, and drops the separate kill-emacs entirely — systemctl restart cycles the daemon itself, so a failed restart leaves the current Emacs alive. Added cj/system-cmd--emacs-service-available-p (systemctl --user cat) for the guard.

Shutdown and reboot now use a strong yes-or-no-p confirm instead of the quick (Y/n) read-char, where RET or space counted as yes — a stray Enter at the prompt could power off the machine. Logout and suspend keep the quick confirm since they are recoverable. The confirm tier rides on a property set by cj/defsystem-command. Tests cover service detection, both restart guards, and the strong-confirm accept/decline paths with the system primitives stubbed.
</content>
</entry>
<entry>
<title>refactor(system-commands): use string interactive spec so undercover instruments</title>
<updated>2026-05-14T12:51:12+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-14T12:51:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=488da25c0f13b2401a7121fd3941aa649207f39e'/>
<id>urn:sha1:488da25c0f13b2401a7121fd3941aa649207f39e</id>
<content type='text'>
`cj/system-cmd' had `(interactive (list (read-shell-command "System
command: ")))' -- the destructured-list interactive spec.  Undercover.el
relies on edebug instrumentation, which doesn't see past that form, so
the entire function body registered as 0 hits under coverage even
though tests call the function directly.

Switch to the equivalent string spec `(interactive "sSystem command: ")'.
Same UX (prompt, history, single-string result), but the body now
instruments correctly and coverage moves from 34/49 to 50/51.

Add one more test that captures the `run-at-time' lambda in
`cj/system-cmd-restart-emacs' and invokes it directly so the inner
`call-process-shell-command' branch registers, taking coverage to 51/51.
</content>
</entry>
<entry>
<title>test(system-commands): cover resolve, run wrapper, exit/restart, menu</title>
<updated>2026-05-14T08:47:01+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-14T08:47:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=ec66cc02c89c0d378c0333cb4f6e35234e39d2f0'/>
<id>urn:sha1:ec66cc02c89c0d378c0333cb4f6e35234e39d2f0</id>
<content type='text'>
Sibling `test-system-commands-keymap.el` locked the keymap shape. This batch covers the runtime helpers and commands:

- `cj/system-cmd--resolve`: trims strings, errors on empty/non-string-non-symbol, round-trips a symbol whose value is a non-empty string, errors on a symbol with empty value.
- `cj/system-cmd`: wraps a plain string in `nohup ... &amp;` and hands it to `start-process-shell-command`; a confirm-tagged var with an N response signals user-error.
- `cj/system-cmd-exit-emacs`: declining the prompt aborts; accepting calls `kill-emacs`.
- `cj/system-cmd-restart-emacs`: declining aborts before scheduling; accepting schedules two timers.
- `cj/system-command-menu`: the completing-read pick routes through `call-interactively` to the right command symbol.

Top-level defvars for `test-sc-my-cmd` and `test-sc-empty-cmd` make the let-bindings dynamic so `symbol-value` reaches them under lexical scope.
</content>
</entry>
</feed>
