summaryrefslogtreecommitdiff
path: root/lisp/documents.el
diff options
context:
space:
mode:
authorJakob L. Kreuze2020-12-27 09:12:13 -0500
committerJakob L. Kreuze2020-12-27 09:12:13 -0500
commit8a9cf74976b49b97da674c642a407c0c6004acf8 (patch)
tree0a5a4bf5361b2cac1e187a30e63187693859c80f /lisp/documents.el
parent07e80b484c82b7a41de37f0c5200ce4ccd75792b (diff)
Kill all org-drill buffers when session is complete.
Diffstat (limited to 'lisp/documents.el')
-rw-r--r--lisp/documents.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/documents.el b/lisp/documents.el
index 55ff72e..4a43403 100644
--- a/lisp/documents.el
+++ b/lisp/documents.el
@@ -297,7 +297,20 @@ Visits LINK, or if LINK names a subdirectory of
(path (-first #'(lambda (path) (s-ends-with-p ".org" path))
(directory-files drill-directory t))))
(find-file path)
- (org-drill)))))
+ (org-drill))))
+
+ ;; Kill all org-drill files when the session is over.
+ ;;
+ ;; n.b. this depends on this PR.
+ ;; <https://gitlab.com/phillord/org-drill/-/merge_requests/17>
+ :hook
+ (org-drill-session-complete .
+ (lambda ()
+ (dolist (buf (cl-remove-if-not
+ #'(lambda (buf)
+ (cl-search "Notes/Drill" (buffer-file-name buf)))
+ (buffer-list)))
+ (kill-buffer buf)))))
;; The org-download package is incredible for quickly pull images into Org
;; documents.

© 2015 - 2026 Jakob L. Kreuze