diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-10 14:42:04 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-10 14:42:04 -0500 |
| commit | 16396d25c2795bd7f8822a695de111d07f588b26 (patch) | |
| tree | c452c193c1eb813cedcd3b4faca030d8775da4a3 /modules/ui-navigation.el | |
| parent | c44a52a7905b605a6537e3ff9bb4fe3afede0485 (diff) | |
| download | dotemacs-16396d25c2795bd7f8822a695de111d07f588b26.tar.gz dotemacs-16396d25c2795bd7f8822a695de111d07f588b26.zip | |
refactor(external-open): consolidate OS-open dispatch in external-open.el
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) -> `cj/external-open-launcher-p' (external-open). Public name now matches its module.
- `cj/identify-external-open-command' (system-utils) -> `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 <-> 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).
Diffstat (limited to 'modules/ui-navigation.el')
0 files changed, 0 insertions, 0 deletions
