diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-10 14:48:25 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-10 14:48:25 -0500 |
| commit | a7071b13d5a3309e28ee03e33acc526d7eaed810 (patch) | |
| tree | b79b547a581646ab04eb784f16bec840b1e3c51a /tests/test-auth-config-toggle-auth-source-debug.el | |
| parent | eb512124d9d587f9f26a17e9031f30a2cfff9476 (diff) | |
| download | dotemacs-a7071b13d5a3309e28ee03e33acc526d7eaed810.tar.gz dotemacs-a7071b13d5a3309e28ee03e33acc526d7eaed810.zip | |
refactor(org-agenda): migrate to cj-cache helper
Phase 5 step 2 of utility-consolidation. The agenda-files cache (four module-level vars + 35-line build-with-cache function) now delegates to `cj-cache.el'. Behavior preserved: cache-hit logging, "Building..." background message, building-flag cleanup on error.
Add `cj/--org-agenda-scan-files' as a pure-ish helper that returns the file list (the slow filesystem walk). `cj/build-org-agenda-list' becomes a thin wrapper that calls `cj/cache-value-or-rebuild' with the scan helper as BUILD-FN and routes the original log lines through :on-hit / :on-build-success.
Drop four module-level state vars:
- `cj/org-agenda-files-cache'
- `cj/org-agenda-files-cache-time'
- `cj/org-agenda-files-cache-ttl'
- `cj/org-agenda-files-building'
Replace with a single `cj/--org-agenda-files-cache' plist held by the helper.
Rewrite the existing test file to test wrapper behavior at the contract level (stub the scan helper, verify wrapper outcomes) instead of poking at internal state vars. 8 tests cover first-call builds, second-call uses cache, force-rebuild bypass, TTL expiration, empty scan, building-flag cleanup on success and error, and error propagation.
Diffstat (limited to 'tests/test-auth-config-toggle-auth-source-debug.el')
0 files changed, 0 insertions, 0 deletions
