aboutsummaryrefslogtreecommitdiff
path: root/org-drill.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-05 05:16:39 -0500
committerCraig Jennings <c@cjennings.net>2026-05-05 05:16:39 -0500
commitf5d67d7a0a48cd68d7f443ca475c0c7bc59a8468 (patch)
treefb5a08026058fdea861a248b1e7103bfea092166 /org-drill.el
parentaa3d724c6bdd3a16391ad95040184c118386d329 (diff)
downloadorg-drill-f5d67d7a0a48cd68d7f443ca475c0c7bc59a8468.tar.gz
org-drill-f5d67d7a0a48cd68d7f443ca475c0c7bc59a8468.zip
fix: guard org-drill-again and org-drill-resume against nil last-session
Both functions bound session to org-drill-last-session and immediately called setf / org-drill-entries-pending-p on it without checking for nil. First-time invocation (or after Emacs restart with no active session) threw an obscure eieio-oset / nil-slot type error instead of a clear message. Added (unless session (user-error ...)) at the top of each function. A user running M-x org-drill-resume cold now sees a sensible message telling them to run org-drill first.
Diffstat (limited to 'org-drill.el')
-rw-r--r--org-drill.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/org-drill.el b/org-drill.el
index 97ba891..0de606c 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -3231,6 +3231,8 @@ unreviewed items. If there are no leftover items in memory, a full
scan will be performed."
(interactive)
(let ((session org-drill-last-session))
+ (unless session
+ (user-error "No previous drill session to continue — run `org-drill' first"))
(setf (oref session cram-mode) nil)
(cond
((cl-plusp (org-drill-pending-entry-count session))
@@ -3249,6 +3251,8 @@ scan will be performed."
exiting them with the `edit' or `quit' options."
(interactive)
(let ((session org-drill-last-session))
+ (unless session
+ (user-error "No suspended drill session to resume — run `org-drill' first"))
(cond
((org-drill-entries-pending-p session)
(org-drill nil nil t))