<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-dirvish-config-file-manager-program.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-10T19:42:04+00:00</updated>
<entry>
<title>refactor(external-open): consolidate OS-open dispatch in external-open.el</title>
<updated>2026-05-10T19:42:04+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-10T19:42:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=16396d25c2795bd7f8822a695de111d07f588b26'/>
<id>urn:sha1:16396d25c2795bd7f8822a695de111d07f588b26</id>
<content type='text'>
Phase 4 of utility-consolidation. Three previously-overlapping helpers (system-utils' `cj/identify-external-open-command' and `cj/--open-with-is-launcher-p', plus the dirvish-only `cj/--file-manager-program-for' shipped earlier today) all answered "which OS-open program should I run?".  Pull the answer into one place: external-open.el.

Move and rename:

- `cj/--open-with-is-launcher-p' (system-utils) -&gt; `cj/external-open-launcher-p' (external-open). Public name now matches its module.
- `cj/identify-external-open-command' (system-utils) -&gt; `cj/external-open-command' (external-open). Returns nil for unsupported hosts instead of signaling -- callers that need a command must handle nil explicitly. The wrapper `cj/xdg-open' (also moved into external-open) converts nil to a `user-error' with a clear message, preserving the user-facing failure shape.
- Delete dirvish's `cj/--file-manager-program-for' helper. `cj/dirvish-open-file-manager-here' now calls `cj/external-open-command' directly. The shell-command fallback for nil-program preserves the previous escape hatch.

Break the system-utils &lt;-&gt; external-open recursive require by moving `cj/xdg-open' (the only system-utils function that external-open used) into external-open along with the dispatch.

Tests reorganized to match the move. Two new test files (`test-external-open-command.el', `test-external-open-launcher-p.el') replace the two system-utils-named test files. The dirvish file-manager-program test goes away with the helper. 11 tests covering Normal/Boundary/Error for the dispatch (plus the new "unsupported host returns nil" contract).

Add `(require \='external-open)' to system-utils.el and `(require \='system-lib)' to external-open.el (for `cj/file-from-context' which xdg-open uses).
</content>
</entry>
<entry>
<title>refactor(dirvish): extract cj/--file-manager-program-for helper</title>
<updated>2026-05-10T18:31:04+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-10T18:31:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=32e57be15a48aa24470e9f3bc6a206c7624bd6b0'/>
<id>urn:sha1:32e57be15a48aa24470e9f3bc6a206c7624bd6b0</id>
<content type='text'>
`cj/dirvish-open-file-manager-here' had its platform-dispatch -- xdg-open / open / explorer / shell fallback -- inline as a four-arm cond branching on `executable-find' and `system-type'.  Lift the choice into `cj/--file-manager-program-for', a pure function from (HAS-XDG-OPEN-P SYSTEM-TYPE) to a program-name string or nil.  The wrapper resolves the live values, asks the helper, and either calls the program or falls back to a shell-command.

Six Normal/Boundary tests cover the four return shapes (xdg-open across system types, darwin/windows-nt without xdg-open, the nil fallback for plain Linux without xdg-open and for unknown system-types like Haiku).
</content>
</entry>
</feed>
