<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/modules/system-lib.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-23T00:32:32+00:00</updated>
<entry>
<title>refactor(auth): consolidate the auth-source secret lookup into one helper</title>
<updated>2026-05-23T00:32:32+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-23T00:32:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=f6e5885b47e3ab244b293f4e478af7e520180710'/>
<id>urn:sha1:f6e5885b47e3ab244b293f4e478af7e520180710</id>
<content type='text'>
The auth-source-search + funcall-the-secret block was copied four times: calendar-sync--calendar-url, cj/auth-source-secret (ai-config), cj/--auth-source-password (transcription), and cj/slack--get-credential. Each searched authinfo, pulled :secret, and called it when the netrc backend returned a function.

I pulled that into cj/auth-source-secret-value in system-lib (a leaf, so calendar-sync doesn't have to depend on ai-config and drag in the gptel stack). It takes an optional user and returns the secret or nil. The four callers now delegate to it: ai-config layers its required-secret error on top, and the others keep their nil-on-miss behavior. With the direct auth-source-search calls gone, I dropped the now-unused (require 'auth-source) from transcription, slack, and calendar-sync. The helper's autoload covers it.

The transcription tests that exercise the delegated path stay green, and the primitive and the error wrapper get their own tests.
</content>
</entry>
<entry>
<title>refactor(system-lib): extract cj/file-from-context from system-utils</title>
<updated>2026-05-10T19:20:45+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-10T19:20:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=aa72245a2a1715ef4fb8b1c3019826540320be80'/>
<id>urn:sha1:aa72245a2a1715ef4fb8b1c3019826540320be80</id>
<content type='text'>
Phase 2.4 of utility-consolidation, the last item in the spec's recommended order. `cj/--file-from-context' resolves "the current file" via a three-step fallback chain (explicit arg, `buffer-file-name', dired file at point) -- a useful pattern for any command that operates on the current file regardless of which kind of buffer the user is in.  Promote to public `cj/file-from-context' and re-home in system-lib.el so other modules (mail capture, external-open, AI conversation, dirvish helpers) can use it without an awkward dependency on system-utils.

Migrate the two callers in system-utils.el (`cj/open-this-file-with' and `cj/open-file-with-command') and add `(require \='system-lib)' there per the Phase 2 exit criterion.

Move the existing 7-test file to `tests/test-system-lib-file-from-context.el' and update its references to the new public name.  The test shape is unchanged: 4 Normal + 3 Boundary cases covering explicit-arg precedence, buffer-file-name fallback, dired fallback, and the all-nil case.
</content>
</entry>
<entry>
<title>refactor(system-lib): extract cj/process-output-or-error and cj/git-output-or-error from coverage-core</title>
<updated>2026-05-10T19:17:25+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-10T19:17:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=57e558ce13fae77eed07095638a753ba75af55d4'/>
<id>urn:sha1:57e558ce13fae77eed07095638a753ba75af55d4</id>
<content type='text'>
Phase 2.3 of utility-consolidation. `cj/--coverage-git-string' was a generic argv-based runner ("run program, return stdout, raise user-error on non-zero with status+output in the message") trapped inside coverage-core.  Lift the generic shape into `cj/process-output-or-error' and add `cj/git-output-or-error' as a one-line wrapper that supplies "git" as the program.  Both live in system-lib.el.

Future callers I have in mind: reconcile-open-repos shell-style git calls (the high-priority data-safety task), vc-config clipboard cloning, mail integrations that touch git for commit signatures.

Six Normal/Boundary/Error tests cover success/no-args/non-zero-exit for the generic runner, the user-error message content (program name, exit status, trimmed output), and the git wrapper's program argument routing.

Migrate coverage-core's `cj/--coverage-git-merge-base' and `cj/--coverage-git-diff' to call the new git wrapper.  Drop the local `cj/--coverage-git-string' definition.  Add `(require \='system-lib)' to coverage-core.el per the Phase 2 exit criterion.
</content>
</entry>
<entry>
<title>refactor(system-lib): extract cj/shell-quote-argument-readable from dev-fkeys</title>
<updated>2026-05-10T19:13:56+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-10T19:13:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=f1e8f0898244bd2d834baf7541d10e5eff351d34'/>
<id>urn:sha1:f1e8f0898244bd2d834baf7541d10e5eff351d34</id>
<content type='text'>
Phase 2.2 of utility-consolidation. The "quote only when shell-unsafe characters appear, otherwise leave the argument readable" pattern was trapped in dev-fkeys as `cj/--f6-shell-quote-argument' alongside its `cj/--f6-shell-safe-argument-regexp' constant. Lift both into system-lib.el under their generic names; the F6 branding hid that the same shape is useful for any generated compile/test command where the surrounding line ends up in a *compilation* buffer the user reads.

Six Normal/Boundary tests cover safe inputs that pass through unchanged (alphanumeric paths, test regexes, `FLAG=value', `host:port'), unsafe inputs that get quoted (spaces, `$', `;', `&amp;', backticks, `*'), and the empty-string boundary.

Migrate dev-fkeys's five callers to the new name and add `(require \='system-lib)' per the Phase 2 exit criterion.
</content>
</entry>
<entry>
<title>refactor(system-lib): extract cj/executable-find-or-warn from mail-config</title>
<updated>2026-05-10T19:04:22+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-10T19:04:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=c75e36f4ec6764142499a3ec965d25895c564cb0'/>
<id>urn:sha1:c75e36f4ec6764142499a3ec965d25895c564cb0</id>
<content type='text'>
Phase 2 of utility-consolidation, first commit per the spec's recommended order. `cj/mail--executable-or-warn' was the right pattern -- check executable-find, return the path, otherwise emit a clear `display-warning' naming the feature -- but it was trapped in mail-config and only mail callers benefited. Lift it into `cj/executable-find-or-warn' in system-lib.el with one new argument: an optional GROUP symbol that flows through to `display-warning' (defaulting to `cj/system-lib') so per-feature warning filters keep working. Mail callers pass `mail-config' explicitly.

Migrate `cj/mail--mbsync-command' and `cj/mail-configure-smtpmail' to the new helper. Drop the local definition. Add `(require \='system-lib)' to mail-config.el per the spec's Phase 2 exit criterion ("consumer modules explicitly require system-lib").

Five Normal/Boundary tests cover the four return-shape cases (program found / program missing / warning content / default vs explicit group).

Other consumers (prog-*.el, dirvish-config.el, browser-config.el) still call `executable-find' directly. Migrating them is a follow-up commit, audited per call site -- the spec flags some `:if' silent checks as intentional and they should NOT switch to the warning helper.
</content>
</entry>
<entry>
<title>fix(tests): Move cj/log-silently to system-lib.el, fix all test failures</title>
<updated>2025-11-15T20:08:47+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-15T20:08:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=8e8152e13b455021e604ea8cb989028bda1c9f5a'/>
<id>urn:sha1:8e8152e13b455021e604ea8cb989028bda1c9f5a</id>
<content type='text'>
Consolidated cj/log-silently function to system-lib.el as the canonical
location for low-level utility functions. This fixes 4 failing tests in
video-audio-recording that couldn't find the function.

Changes:
- Move cj/log-silently to system-lib.el (from system-utils.el)
- Remove duplicate definition from org-agenda-config-debug.el
- Remove duplicate definition from system-utils.el
- Add (require 'system-lib) to all modules using cj/log-silently:
  - video-audio-recording.el
  - org-agenda-config-debug.el
  - media-utils.el (also removed declare-function)
  - elfeed-config.el (replaced system-utils with system-lib)
  - wrap-up.el

Test Results:
- Before: 112/113 passing (4 video-audio-recording tests failing)
- After: 113/113 passing ✓

All tests now pass with zero failures.

Fixes TODO #809-895 (move cj/log-silently to system-lib.el)
</content>
</entry>
<entry>
<title>feat:system: Add system utility library with executable check</title>
<updated>2025-11-09T21:33:17+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-09T21:33:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=bace209b19449c366c933a752a289d52e5f40c52'/>
<id>urn:sha1:bace209b19449c366c933a752a289d52e5f40c52</id>
<content type='text'>
Introduce a new `system-lib.el` module providing low-level system
utility functions, including function `cj/executable-exists-p` to
check for the availability of programs in PATH. Integrate this
library in `init.el`.

test(system): Add unit tests for executable check function

Create comprehensive unit tests for `cj/executable-exists-p` in
`system-lib.el`, ensuring coverage of normal, boundary and error
scenarios.
</content>
</entry>
</feed>
