summaryrefslogtreecommitdiff
path: root/org-drill.el
diff options
context:
space:
mode:
authoreeeickythump <devnull@localhost>2011-07-01 09:18:25 +1200
committereeeickythump <devnull@localhost>2011-07-01 09:18:25 +1200
commit8618a532c78fbdc7becc0b3c34c3bb1a027d75cb (patch)
tree4135b4f46b2ef014ba59129d199a2ed29d824304 /org-drill.el
parentec7b5a0cf0961f4bff563d22083c328588721d75 (diff)
downloadorg-drill-2.3.5.tar.gz
org-drill-2.3.5.zip
- Improved progress bar while collecting due items. It is no longer able to overflow2.3.5
to multiple lines. - Added documentation for 'org-drill-sm5-initial-interval'.
Diffstat (limited to 'org-drill.el')
-rwxr-xr-xorg-drill.el20
1 files changed, 16 insertions, 4 deletions
diff --git a/org-drill.el b/org-drill.el
index 29e1657..9f84fac 100755
--- a/org-drill.el
+++ b/org-drill.el
@@ -2,7 +2,7 @@
;;; org-drill.el - Self-testing using spaced repetition
;;;
;;; Author: Paul Sexton <eeeickythump@gmail.com>
-;;; Version: 2.3.4
+;;; Version: 2.3.5
;;; Repository at http://bitbucket.org/eeeickythump/org-drill/
;;;
;;;
@@ -2284,6 +2284,19 @@ one of the following values:
due))))
+(defun org-drill-progress-message (collected scanned)
+ (when (zerop (% scanned 50))
+ (let* ((meter-width 40)
+ (sym1 (if (oddp (floor scanned (* 50 meter-width))) ?| ?.))
+ (sym2 (if (eql sym1 ?.) ?| ?.)))
+ (message "Collecting due drill items:%4d %s%s"
+ collected
+ (make-string (% (ceiling scanned 50) meter-width)
+ sym2)
+ (make-string (- meter-width (% (ceiling scanned 50) meter-width))
+ sym1)))))
+
+
(defun org-drill (&optional scope resume-p)
"Begin an interactive 'drill session'. The user is asked to
review a series of topics (headers). Each topic is initially
@@ -2344,14 +2357,13 @@ than starting a new one."
(warned-about-id-creation nil))
(org-map-drill-entries
(lambda ()
- (when (zerop (% (incf cnt) 50))
- (message "Processing drill items: %4d%s"
+ (org-drill-progress-message
(+ (length *org-drill-new-entries*)
(length *org-drill-overdue-entries*)
(length *org-drill-young-mature-entries*)
(length *org-drill-old-mature-entries*)
(length *org-drill-failed-entries*))
- (make-string (ceiling cnt 50) ?.)))
+ (incf cnt))
(cond
((not (org-drill-entry-p))
nil) ; skip