aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-21 02:16:42 -0400
committerCraig Jennings <c@cjennings.net>2026-06-21 02:16:42 -0400
commit4a8c572ba6a64be997be072b44ef5ff62674d820 (patch)
tree210e4e13238b4c73c4b62a3e4864827df64bec66 /modules
parent55922a54652d74d047a41728e5ce7b2f86d9a3d7 (diff)
downloaddotemacs-4a8c572ba6a64be997be072b44ef5ff62674d820.tar.gz
dotemacs-4a8c572ba6a64be997be072b44ef5ff62674d820.zip
fix: load games-config via the malyon hook, not an autoload chain
The previous deferral (03d8b587) autoloaded malyon to games-config, but games-config doesn't define malyon. It leaves the command to the malyon package, so M-x malyon loaded games-config, found malyon still undefined, and errored "Autoloading games-config.el failed to define function malyon". Emacs won't chain through a second autoload. malyon and 2048-game autoload their own commands via package.el, so games-config should never own them. init.el now loads games-config via (with-eval-after-load 'malyon ...), and games-config just sets malyon-stories-directory when malyon loads. M-x malyon loads the package as a real command, then games-config applies its config. The earlier batch check loaded the files by hand and missed the autoload failure. The new test resolves the autoload the way M-x does (autoload-do-load), so the real path is covered now.
Diffstat (limited to 'modules')
-rw-r--r--modules/games-config.el32
1 files changed, 11 insertions, 21 deletions
diff --git a/modules/games-config.el b/modules/games-config.el
index 1e5ba5b87..aa26d31ee 100644
--- a/modules/games-config.el
+++ b/modules/games-config.el
@@ -6,37 +6,27 @@
;; Layer: 4 (Optional).
;; Category: O.
;; Load shape: command (deferred).
-;; Eager reason: none; loaded on first use of `malyon' or `2048-game'.
-;; Top-level side effects: package configuration via use-package (deferred).
-;; Runtime requires: none.
+;; Eager reason: none; loaded by init.el when malyon loads.
+;; Top-level side effects: sets malyon-stories-directory after malyon loads.
+;; Runtime requires: user-constants.
;; Direct test load: yes.
;;
;; Configuration for game packages.
;;
-;; - Malyon for playing interactive fiction and text adventures in Z-machine format
-;; (stories directory: ~/sync/org/text.games/)
-;; - 2048 number-tile puzzle game
+;; - Malyon: interactive fiction / Z-machine player (stories under ~/sync/org/text.games/).
+;; - 2048: number-tile puzzle.
;;
-;; init.el autoloads `malyon' and `2048-game' to this module instead of
-;; requiring it eagerly, so the first invocation of either command loads
-;; games-config, which configures and then loads the package.
+;; malyon and 2048-game autoload their own commands via package.el, so this
+;; module owns neither command -- it only supplies malyon's stories directory.
+;; init.el loads it via `with-eval-after-load 'malyon', so it loads on first
+;; use rather than at startup.
;;
;;; Code:
-;; ----------------------------------- Malyon ----------------------------------
-;; text based adventure player
+(require 'user-constants) ;; org-dir
-(use-package malyon
- :defer t
- :commands (malyon)
- :config
+(with-eval-after-load 'malyon
(setq malyon-stories-directory (concat org-dir "text.games/")))
-;; ------------------------------------ 2048 -----------------------------------
-;; combine numbered tiles to create the elusive number 2048.
-(use-package 2048-game
- :defer t
- :commands (2048-game))
-
(provide 'games-config)
;;; games-config.el ends here.