diff options
| author | eeeickythump <devnull@localhost> | 2010-09-08 07:55:32 +1200 |
|---|---|---|
| committer | eeeickythump <devnull@localhost> | 2010-09-08 07:55:32 +1200 |
| commit | 7806c770d6af92f2e91afab837ac6bb908abfef8 (patch) | |
| tree | ff6f8d5a968cd3b7a02e796e139765da66a86da7 | |
| parent | 259033811d57bcd2a5ec56f46b0f56ce028aa727 (diff) | |
| download | org-drill-7806c770d6af92f2e91afab837ac6bb908abfef8.tar.gz org-drill-7806c770d6af92f2e91afab837ac6bb908abfef8.zip | |
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.
| -rw-r--r-- | org-drill.el | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/org-drill.el b/org-drill.el index 50d8520..8485d0f 100644 --- a/org-drill.el +++ b/org-drill.el @@ -1,7 +1,7 @@ ;;; org-drill.el - Self-testing with org-learn ;;; ;;; Author: Paul Sexton <eeeickythump@gmail.com> -;;; Version: 1.3 +;;; Version: 1.3.1 ;;; Repository at http://bitbucket.org/eeeickythump/org-drill/ ;;; ;;; @@ -486,7 +486,7 @@ the current topic." (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" (propertize @@ -521,6 +521,7 @@ Consider reformulating the item to make it easier to remember.\n" (case ch (?q nil) (?e 'edit) + (?s 'skip) (otherwise t)))) @@ -685,6 +686,8 @@ See `org-drill' for more details." nil) ((eql cont 'edit) 'edit) + ((eql cont 'skip) + 'skip) (t (save-excursion (org-drill-reschedule))))))) @@ -731,10 +734,13 @@ See `org-drill' for more details." (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 () @@ -808,6 +814,8 @@ maximum number of items." ((eql result 'edit) (setq end-pos (point-marker)) (return-from org-drill-entries nil)) + ((eql result 'skip) + nil) ; skip this item (t (cond ((<= result org-drill-failure-quality) @@ -906,16 +914,16 @@ agenda-with-archives (interactive) (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))) (unwind-protect |
