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 | 2032c13811a9d5f39301085ca70f476ca6813529 (patch) | |
| tree | 5ed64f2faffba1d49ddc3cc0f12f4774635385b0 /modules | |
| parent | 27453b4faa9dcd6a672dabd06b2a1fb300fedeef (diff) | |
| download | dotemacs-2032c13811a9d5f39301085ca70f476ca6813529.tar.gz dotemacs-2032c13811a9d5f39301085ca70f476ca6813529.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 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 -------------------------------- |
