aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-12 10:12:31 -0500
committerCraig Jennings <c@cjennings.net>2026-06-12 10:13:28 -0500
commit4d9c9fa672ec57551fa8c9d2d25ea60b59dbef52 (patch)
tree65b71a6d920c078a943d72783987b451e2ce1d38 /modules
parent4a1ecf647270e49da1a185f4d52c2553e1fedba8 (diff)
downloaddotemacs-4d9c9fa672ec57551fa8c9d2d25ea60b59dbef52.tar.gz
dotemacs-4d9c9fa672ec57551fa8c9d2d25ea60b59dbef52.zip
fix(org-drill): let-bind org-refile-targets and target real drill files
cj/drill-refile used setq, permanently replacing the session-wide org-refile-targets so every refile anywhere offered only drill targets until restart; and its (drill-dir :maxlevel . 1) entry named a bound variable, which org reads as a directory string rather than a file list, so the drill side yielded nothing. Let-bind org-refile-targets and supply (directory-files drill-dir t "\\.org$") as the file list. The stale test (which asserted the buggy drill-dir spec) is rewritten into two: file-list targets and no global clobber.
Diffstat (limited to 'modules')
-rw-r--r--modules/org-drill-config.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/org-drill-config.el b/modules/org-drill-config.el
index 296b0550..b2d2a509 100644
--- a/modules/org-drill-config.el
+++ b/modules/org-drill-config.el
@@ -95,9 +95,10 @@ With a prefix arg OTHER-DIR, prompt for the directory instead of `drill-dir'."
(defun cj/drill-refile ()
"Refile to a drill file."
(interactive)
- (setq org-refile-targets '((nil :maxlevel . 1)
- (drill-dir :maxlevel . 1)))
- (call-interactively 'org-refile))
+ (let ((org-refile-targets
+ `((nil :maxlevel . 1)
+ (,(directory-files drill-dir t "\\.org$") :maxlevel . 1))))
+ (call-interactively 'org-refile)))
;; ------------------------------- Drill Keymap --------------------------------