diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-24 18:36:19 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-24 18:36:19 -0500 |
| commit | 36a453d2c1237b49f594b23433858a0146dbf31e (patch) | |
| tree | 2aa337a8bae309933e350a7120325b00b0b259ac /modules/calendar-sync.el | |
| parent | 63c60fefd4d03ba22d3a36f793fe466daae43c7e (diff) | |
| download | dotemacs-36a453d2c1237b49f594b23433858a0146dbf31e.tar.gz dotemacs-36a453d2c1237b49f594b23433858a0146dbf31e.zip | |
refactor(load-graph): make hidden module dependencies explicit
Phase 2 of the load-graph project. I fixed the seven hidden dependencies the classification surfaced, so each module declares what it uses instead of relying on init order.
- system-defaults now requires host-environment and user-constants at runtime. They were eval-when-compile only, but env-bsd-p and user-home-dir are read at load, so the compiled module couldn't load standalone.
- custom-buffer-file, dev-fkeys, calendar-sync, and video-audio-recording require keybindings and drop their (when (boundp 'cj/custom-keymap) ...) shims. The shim silently dropped the C-; binding when the module loaded before keybindings. The explicit require makes the dependency real.
- flycheck-config and mail-config require keybindings for their cj/custom-keymap bindings (a use-package :map and a direct keymap-set).
- Removed a dead eval-when-compile (defvar cj/custom-keymap) in transcription-config; nothing there used the variable.
No init.el load-order change. keybindings and the foundation modules already load before these, so the requires are no-ops at startup and only fix standalone and test loading.
I verified each fix with a fresh emacs --batch (require 'X), then swept all modules standalone: every one loads or fails only with a clear missing-package message. Full make test, make validate-modules, and an init smoke all pass. Module headers and the inventory's hidden-dependency section are updated to mark the seven resolved.
Diffstat (limited to 'modules/calendar-sync.el')
| -rw-r--r-- | modules/calendar-sync.el | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/modules/calendar-sync.el b/modules/calendar-sync.el index 4d1ea219..21ef8727 100644 --- a/modules/calendar-sync.el +++ b/modules/calendar-sync.el @@ -13,11 +13,8 @@ ;; Top-level side effects: defines a calendar keymap and conditionally registers ;; it under cj/custom-keymap; timer and network fetches guarded by ;; config/noninteractive checks. -;; Runtime requires: cl-lib, subr-x, system-lib, cj-org-text-lib. keybindings is -;; needed for the C-; g binding but only reached through a boundp guard, so the -;; binding silently drops standalone. Phase 2 fix. -;; Direct test load: conditional (C-; g registration skipped without keybindings; -;; private config optional). +;; Runtime requires: cl-lib, subr-x, system-lib, cj-org-text-lib, keybindings. +;; Direct test load: yes (private config optional; degrades cleanly when absent). ;; ;; Simple, reliable one-way sync from multiple calendars to Org mode. ;; Downloads .ics files from calendar URLs (Google, Proton, etc.) and @@ -87,6 +84,7 @@ (require 'subr-x) (require 'system-lib) ;; provides cj/auth-source-secret-value (leaf; no ai-config dep) (require 'cj-org-text-lib) +(require 'keybindings) ;; provides cj/custom-keymap (defun calendar-sync--log-silently (format-string &rest args) "Log FORMAT-STRING with ARGS without requiring the full config." @@ -1705,18 +1703,16 @@ Syncs all calendars immediately, then every `calendar-sync-interval-minutes'." "S" #'calendar-sync-start "x" #'calendar-sync-stop) -;; Only set up keybindings if cj/custom-keymap exists (not in test environment) -(when (boundp 'cj/custom-keymap) - (keymap-set cj/custom-keymap "g" cj/calendar-map) - - (with-eval-after-load 'which-key - (which-key-add-key-based-replacements - "C-; g" "calendar sync menu" - "C-; g s" "sync now" - "C-; g i" "sync status" - "C-; g t" "toggle auto-sync" - "C-; g S" "start auto-sync" - "C-; g x" "stop auto-sync"))) +(keymap-set cj/custom-keymap "g" cj/calendar-map) + +(with-eval-after-load 'which-key + (which-key-add-key-based-replacements + "C-; g" "calendar sync menu" + "C-; g s" "sync now" + "C-; g i" "sync status" + "C-; g t" "toggle auto-sync" + "C-; g S" "start auto-sync" + "C-; g x" "stop auto-sync")) ;;; Initialization |
