aboutsummaryrefslogtreecommitdiff
path: root/systemd
Commit message (Collapse)AuthorAgeFilesLines
* fix(calendar-sync): run the sync from a timer instead of the agenda hookCraig Jennings23 hours2-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hourly timer armed itself from org-agenda-mode-hook, so a session where I never opened the agenda never synced at all. After a reboot that is every session until the first agenda call. I found it with all three calendar files still frozen at the pre-reboot write, five hours stale. The deferral had a real reason. Feed URLs behind :secret-host live in authinfo.gpg, and starting at load would prompt for a passphrase on a cold gpg-agent. The cost was worse than what it bought. A user timer owns the schedule now, every ten minutes. calendar-sync-auto-start defaults to nil so the editor no longer arms its own. scripts/calendar-sync-run is the batch entry point, and it blocks until every calendar leaves the syncing state. The pipeline is asynchronous end to end, so a batch Emacs that returns early exits zero having written nothing. Installing it on a machine that resolves its feeds through :secret-host surfaced two bugs the inline-url machine could never show: - cj/auth-source-secret-value called auth-source-search behind nothing but a declare-function, which quiets the compiler and loads nothing. An interactive Emacs always has auth-source in by the time anyone calls, so the omission stayed invisible until a batch -Q sync died on a void function. The require is guarded on fboundp. An unconditional one reloads auth-source over whatever is already there, which replaced a caller's stubbed search mid-call and sent an existing test out to the real authinfo. - A synchronous failure in one calendar aborted the whole loop. The async callbacks record their own failures, but they never run when the error lands before a process starts. Resolving a :secret-host feed signals outright on a cold agent. Failures are contained per calendar now, so one bad feed no longer costs the other two. A failed row prints the reason it recorded. Batch Emacs discards the *Messages* buffer the interactive path logs to, so without it the journal shows only "error", with no way to tell a cold agent from a revoked token.
* feat(agenda): refresh the render cache on a timer, without the daemonCraig Jennings4 days2-0/+31
The surface reading this has to stay correct while Emacs is down, and emacsclient is exactly the thing that cannot. So the writer is a batch Emacs and a user timer runs it every five minutes. - scripts/agenda-render-cache writes the cache from a batch Emacs. It resolves the agenda file list through the config's own resolver rather than restating it, so adding a calendar source stays a one-place change. - The timer uses OnCalendar so Persistent actually applies. On a monotonic schedule it is silently ignored, and a machine that slept would come back to a stale file with nothing to trigger a catch-up. - The window is now three days, yesterday through tomorrow. A consumer drawing a rolling window centred on now has nothing to draw for the part of its span outside today, which late in the evening is half the surface. The keyword list moved to user-constants, where a batch Emacs can reach it without this config's package dependencies. Without it org did not recognise DOING or VERIFY, so it stopped parsing those headlines as tasks at all: the keyword and priority cookie stayed glued to the front of every title and each row reported no keyword and not-done. The file parsed cleanly and was wrong, which is the failure worth guarding. The bats tests run against a fixture and this checkout, not the machine's real agenda and installed config. Asserting over live data let the same suite pass on a day that happened to have no keyworded entries.