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/system-defaults.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/system-defaults.el')
| -rw-r--r-- | modules/system-defaults.el | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/modules/system-defaults.el b/modules/system-defaults.el index 33d93bbc..8ef6181a 100644 --- a/modules/system-defaults.el +++ b/modules/system-defaults.el @@ -11,11 +11,9 @@ ;; Top-level side effects: mutates global defaults (many `setq'), advises ;; `display-warning', adds a `display-buffer-alist' entry, remaps one global ;; key. -;; Runtime requires: autorevert, server, bookmark; host-environment -;; (`env-bsd-p') and user-constants (`user-home-dir') are read at load but -;; currently only required via eval-when-compile — Phase 2 to make explicit. -;; Direct test load: conditional (host-environment and user-constants must load -;; first; the compiled module cannot resolve them standalone yet). +;; Runtime requires: autorevert, server, bookmark, host-environment +;; (`env-bsd-p'), user-constants (`user-home-dir'). +;; Direct test load: yes. ;; ;; Loads during init to set sane defaults: UTF-8 everywhere, quiet prompts, synced clipboards, ;; and hands-off async shell buffers. Nothing to call—just launch Emacs and the environment is ready. @@ -31,13 +29,12 @@ (require 'server) (require 'bookmark) -;; `host-environment' and `user-constants' are loaded earlier in init.el, -;; so they are available at runtime when this module loads. The -;; `eval-when-compile' forms here are byte-compile hints to silence -;; free-variable / free-function warnings when this module is compiled -;; in isolation; no runtime requires are needed. -(eval-when-compile (require 'host-environment)) -(eval-when-compile (require 'user-constants)) +;; host-environment (`env-bsd-p') and user-constants (`user-home-dir') are read +;; at load time below, so require them at runtime, not only at compile time. +;; init.el already loads them earlier; the explicit requires let this module +;; load standalone. +(require 'host-environment) +(require 'user-constants) ;; -------------------------- Native Comp Preferences -------------------------- |
