Anonymous avatar Anonymous committed 2fffa18

Added ability to skip cards during review (answer is not shown).
Fixed bug that caused sessions to end with "ran out of drill items" error.

Comments (0)

Files changed (1)

 ;;; org-drill.el - Self-testing with org-learn
 ;;; Author: Paul Sexton <>
-;;; Version: 1.3 
+;;; Version: 1.3.1
 ;;; Repository at
                      (first fmt-and-args)
                      (rest fmt-and-args))
             (concat "Press any key to see the answer, "
-                    "e=edit, t=tags, q=quit."))))
+                    "e=edit, t=tags, s=skip, q=quit."))))
     (setq prompt
           (format "%s %s %s %s"
     (case ch
       (?q nil)
       (?e 'edit)
+      (?s 'skip)
       (otherwise t))))
        ((eql cont 'edit)
+       ((eql cont 'skip)
+        'skip)
 (defun org-drill-entries-pending-p ()
-  (or *org-drill-new-entries*
-      *org-drill-failed-entries*
-      *org-drill-mature-entries*
-      *org-drill-again-entries*))
+  (or *org-drill-again-entries*
+      (and (not (org-drill-maximum-item-count-reached-p))
+           (not (org-drill-maximum-duration-reached-p))
+           (or *org-drill-new-entries*
+               *org-drill-failed-entries*
+               *org-drill-mature-entries*
+               *org-drill-again-entries*))))
 (defun org-drill-pending-entry-count ()
          ((eql result 'edit)
           (setq end-pos (point-marker))
           (return-from org-drill-entries nil))
+         ((eql result 'skip)
+          nil)   ; skip this item
            ((<= result org-drill-failure-quality)
   (let ((entries nil)
         (failed-entries nil)
-        (*org-drill-new-entries* nil)
-        (*org-drill-mature-entries* nil)
-        (*org-drill-failed-entries* nil)
-        (*org-drill-again-entries* nil)
-        (*org-drill-done-entries* nil)
         (result nil)
         (results nil)
         (end-pos nil)
         (cnt 0))
     (block org-drill
+      (setq *org-drill-done-entries* nil
+            *org-drill-new-entries* nil
+            *org-drill-mature-entries* nil
+            *org-drill-failed-entries* nil
+            *org-drill-again-entries* nil)
       (setq *org-drill-session-qualities* nil)
       (setq *org-drill-start-time* (float-time (current-time)))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.