diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-12 10:49:39 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-12 10:49:39 -0500 |
| commit | 950c98c39edb42c5bb65f8ddb1f815e61b8814dc (patch) | |
| tree | bb2c8b64b4142f96786246b1d47095bd00c786c3 /modules | |
| parent | 387b445c998d6f45b6e4e3705d9fd2c262f22a68 (diff) | |
| download | dotemacs-950c98c39edb42c5bb65f8ddb1f815e61b8814dc.tar.gz dotemacs-950c98c39edb42c5bb65f8ddb1f815e61b8814dc.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.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/org-drill-config.el b/modules/org-drill-config.el index b2d2a509..2c6e400e 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 -------------------------------- |
