From f5d67d7a0a48cd68d7f443ca475c0c7bc59a8468 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 05:16:39 -0500 Subject: 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. --- org-drill.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'org-drill.el') 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)) -- cgit v1.2.3