From 8a9cf74976b49b97da674c642a407c0c6004acf8 Mon Sep 17 00:00:00 2001 From: Jakob L. Kreuze Date: Sun, 27 Dec 2020 09:12:13 -0500 Subject: Kill all org-drill buffers when session is complete. --- lisp/documents.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lisp/documents.el') 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. + ;; + :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. -- cgit v1.3