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
commit205ac5464a5d312131d201cb9f1a4aa67cf2c866 (patch)
tree08c8185d45352b437970db4f09cd4bbb3991a310 /modules
parentd56bbf5c38801afc674672618e034dd8ff4be1ce (diff)
downloaddotemacs-205ac5464a5d312131d201cb9f1a4aa67cf2c866.tar.gz
dotemacs-205ac5464a5d312131d201cb9f1a4aa67cf2c866.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 --------------------------------