aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-12 10:49:39 -0500
committerCraig Jennings <c@cjennings.net>2026-06-12 10:49:39 -0500
commit8c713514d1a09f800141194b59fb276978d5da88 (patch)
tree3068066546d2e3d937487022218005e89232e802 /modules
parente170eccc2bafd36befedc5edc0792530f9fd21d1 (diff)
downloaddotemacs-8c713514d1a09f800141194b59fb276978d5da88.tar.gz
dotemacs-8c713514d1a09f800141194b59fb276978d5da88.zip
fix(org-drill): route drill-refile targets through the validated helper
The prior fix listed drill files with a raw directory-files call, bypassing cj/--drill-files-or-error, the shared validated entry point the other drill commands use. That skipped the missing/unreadable-dir user-error, fell through silently on an empty dir, and included leading-dot .org files the module otherwise excludes. Route through cj/--drill-files-or-error + expand-file-name, keeping the let binding so the session-wide org-refile-targets still survives. The test is rewritten into three: validated-helper targets, no global clobber, and a user-error on a missing drill dir.
Diffstat (limited to 'modules')
-rw-r--r--modules/org-drill-config.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/org-drill-config.el b/modules/org-drill-config.el
index b2d2a5099..2c6e400e0 100644
--- a/modules/org-drill-config.el
+++ b/modules/org-drill-config.el
@@ -97,7 +97,9 @@ With a prefix arg OTHER-DIR, prompt for the directory instead of `drill-dir'."
(interactive)
(let ((org-refile-targets
`((nil :maxlevel . 1)
- (,(directory-files drill-dir t "\\.org$") :maxlevel . 1))))
+ (,(mapcar (lambda (f) (expand-file-name f drill-dir))
+ (cj/--drill-files-or-error drill-dir))
+ :maxlevel . 1))))
(call-interactively 'org-refile)))
;; ------------------------------- Drill Keymap --------------------------------