diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-12 13:29:38 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-12 13:29:38 -0500 |
| commit | fad6f3288ba7c9451bd0b2e0d38c67d267b7fc19 (patch) | |
| tree | 710a7f30ed5d9acd0b7f739655546556931f7f5d /tests/test-org-drill-first-function.el | |
| parent | c72d4abc17ae7bed792fa610c0a67b917e191f4b (diff) | |
| download | dotemacs-fad6f3288ba7c9451bd0b2e0d38c67d267b7fc19.tar.gz dotemacs-fad6f3288ba7c9451bd0b2e0d38c67d267b7fc19.zip | |
refactor(org-drill): hoist the commands out of :config and clear the byte-compile warnings
The `cj/drill-*` defuns and `cj/drill-map` lived inside the `use-package org-drill` `:config` block, so the byte-compiler never registered them — every cross-reference between them warned ("function `cj/drill-this-file' is not known", and so on). I moved all of that to module top level, where the compiler sees it. The ten `(setq org-drill-...)` lines became a `:custom` block (no more "assignment to free variable"). Added `(require 'user-constants)` and `(require 'keybindings)` for `drill-dir` and `cj/custom-keymap`, plus `declare-function` for `org-drill`, `org-drill-resume`, `org-capture`, and `org-refile`. The module byte-compiles clean now, and `C-; D` still mounts the drill submenu with the same leaf keys.
I also gave `tests/test-org-drill-first-function.el` a `cj/custom-keymap` stub: its "loads without error" test does a bare `load` of the module, which now runs the keymap mount at load time instead of deferring it inside `:config`.
Diffstat (limited to 'tests/test-org-drill-first-function.el')
| -rw-r--r-- | tests/test-org-drill-first-function.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test-org-drill-first-function.el b/tests/test-org-drill-first-function.el index 925cdf84..69ca28f9 100644 --- a/tests/test-org-drill-first-function.el +++ b/tests/test-org-drill-first-function.el @@ -14,6 +14,12 @@ (require 'ert) +;; `org-drill-config.el' mounts its keymap under `cj/custom-keymap' at load +;; time; in a real session that's defined by keybindings.el, but a bare +;; `load' of the module needs it stubbed (see `test-org-drill-config-loads-without-error'). +(defvar cj/custom-keymap (make-sparse-keymap) + "Stub custom keymap for the org-drill-config load test.") + (ert-deftest test-org-drill-first-function-not-defined-without-compat () "Verify that 'first' function doesn't exist by default in modern Emacs. |
