diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-15 02:13:37 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-15 02:13:37 -0500 |
| commit | cba8cc00cb8553650fb9176b8843d2c64e8064b5 (patch) | |
| tree | 52a0c6e4a1a3e1d8d3b7b5c5d982fc4e486d837b /modules/wrap-up.el | |
| parent | b9af4484a3d9f915f0018b29a55c404e01591b0c (diff) | |
| download | dotemacs-cba8cc00cb8553650fb9176b8843d2c64e8064b5.tar.gz dotemacs-cba8cc00cb8553650fb9176b8843d2c64e8064b5.zip | |
test(architecture): guard top-level timers + add startup-contract smoke test
Add a tiny source-level architecture suite at
tests/test-architecture-startup-contracts.el with two checks:
- Only keybindings.el may globally own the exact C-; prefix. Catches
accidental cross-module rebinding before it ships.
- Top-level timer scheduling (run-with-timer / run-at-time /
run-with-idle-timer) must be guarded by (unless noninteractive ...)
so requiring a module in batch / test mode does not schedule
startup timers. Timer calls inside defuns are exempt -- the test
only rejects forms that execute their body when the module loads.
Four modules had unguarded top-level timer scheduling and would have
tripped the new test. Wrap their startup hooks/timers in
(unless noninteractive ...):
- modules/org-agenda-config.el: 10s idle cache build
- modules/org-refile-config.el: 5s idle cache build
- modules/quick-video-capture.el: after-init-hook + 2s fallback
- modules/wrap-up.el: emacs-startup-hook bury-buffers delay
The contract being protected is "requiring a module in batch should
not start a clock running." Test failures will now point straight at
the offending file/form.
Diffstat (limited to 'modules/wrap-up.el')
| -rw-r--r-- | modules/wrap-up.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/wrap-up.el b/modules/wrap-up.el index 523d55b29..93b747761 100644 --- a/modules/wrap-up.el +++ b/modules/wrap-up.el @@ -25,7 +25,8 @@ (defun cj/bury-buffers-after-delay () "Run cj/bury-buffers after a delay." (run-with-timer 1 nil 'cj/bury-buffers)) -(add-hook 'emacs-startup-hook 'cj/bury-buffers-after-delay) +(unless noninteractive + (add-hook 'emacs-startup-hook 'cj/bury-buffers-after-delay)) (cj/log-silently "<-- end of init file.") |
