From bac40a5dbc241cab055f92431a80b7971896fde4 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 05:23:34 -0500 Subject: fix: clear stale end-pos on resume so final-report fires (upstream #33) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a user interrupted a drill session to edit or capture, the session's end-pos slot got set to a marker (or :quit). The end-of- org-drill cond branched on end-pos: if set, show resume message and skip org-drill-final-report. That worked for the first interruption. But on org-drill-resume, the session was reused with end-pos still carrying the prior marker. Even when the resumed session completed normally, the same cond branch fired again — silently skipping final-report. Clear end-pos at the top of org-drill when resume-p is non-nil, per Markus's proposed patch on the upstream issue. The resumed session can now reach the final-report branch. --- org-drill.el | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'org-drill.el') diff --git a/org-drill.el b/org-drill.el index f996f15..6872d29 100644 --- a/org-drill.el +++ b/org-drill.el @@ -3150,6 +3150,13 @@ work correctly with older versions of org mode. Your org mode version (%s) appea (setq org-drill-last-session (org-drill-session))))) (cl-block org-drill + ;; Clear stale `end-pos' on resume. The slot was set when the + ;; user interrupted the previous session (edit / quit), and + ;; carrying it over makes the post-resume `(if (oref session + ;; end-pos) ...)' branch fire — silently skipping + ;; `org-drill-final-report' (upstream issue #33). + (when resume-p + (setf (oref session end-pos) nil)) (unless resume-p (org-drill-free-markers session t) (setf (oref session cram-mode) cram -- cgit v1.2.3