[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill eb370c7405 077/251: - Moved a line with side eff
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill eb370c7405 077/251: - Moved a line with side effects to earlier in the file, possibly fixing an |
Date: |
Mon, 17 Jan 2022 18:59:03 -0500 (EST) |
branch: elpa/org-drill
commit eb370c740500af0c2fd6292c9f87c1fb91b68828
Author: Paul Sexton <eeeickythump@gmail.com>
Commit: Paul Sexton <eeeickythump@gmail.com>
- Moved a line with side effects to earlier in the file, possibly fixing an
obscure bug where stuff inside [square brackets] in source code blocks
was being incorrectly interpreted as cloze text the first time a drill
session was run (the problem did not recur if the session was exited and run
again).
- Inside the main org-drill function, moved the anonymous mapping function
out
to a separate named function (org-map-drill-entry-function).
---
org-drill.el | 102 +++++++++++++++++++++++++++++++----------------------------
1 file changed, 53 insertions(+), 49 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index 81012e1d1b..83b2b08573 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.4.5
+;;; Version: 2.4.6
;;; Repository at http://bitbucket.org/eeeickythump/org-drill/
;;;
;;;
@@ -203,6 +203,8 @@ during a drill session."
face default
window t))
+(add-hook 'org-font-lock-set-keywords-hook 'org-drill-add-cloze-fontification)
+
(defvar org-drill-hint-separator "||"
"String which, if it occurs within a cloze expression, signifies that the
@@ -2517,11 +2519,55 @@ STATUS is one of the following values:
(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)))))
+ collected
+ (make-string (% (ceiling scanned 50) meter-width)
+ sym2)
+ (make-string (- meter-width (% (ceiling scanned 50)
meter-width))
+ sym1)))))
+
+
+(defun org-map-drill-entry-function ()
+ (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*))
+ (incf cnt))
+ (cond
+ ((not (org-drill-entry-p))
+ nil) ; skip
+ (t
+ (when (and (not warned-about-id-creation)
+ (null (org-id-get)))
+ (message (concat "Creating unique IDs for items "
+ "(slow, but only happens once)"))
+ (sit-for 0.5)
+ (setq warned-about-id-creation t))
+ (org-id-get-create) ; ensure drill entry has unique ID
+ (destructuring-bind (status due age)
+ (org-drill-entry-status)
+ (case status
+ (:unscheduled
+ (incf *org-drill-dormant-entry-count*))
+ ;; (:tomorrow
+ ;; (incf *org-drill-dormant-entry-count*)
+ ;; (incf *org-drill-due-tomorrow-count*))
+ (:future
+ (incf *org-drill-dormant-entry-count*)
+ (if (eq -1 due)
+ (incf *org-drill-due-tomorrow-count*)))
+ (:new
+ (push (point-marker) *org-drill-new-entries*))
+ (:failed
+ (push (point-marker) *org-drill-failed-entries*))
+ (:young
+ (push (point-marker) *org-drill-young-mature-entries*))
+ (:overdue
+ (push (list (point-marker) due age) overdue-data))
+ (:old
+ (push (point-marker) *org-drill-old-mature-entries*))
+ )))))
(defun org-drill (&optional scope drill-match resume-p)
@@ -2597,48 +2643,7 @@ work correctly with older versions of org mode. Your org
mode version (%s) appea
(let ((org-trust-scanner-tags t)
(warned-about-id-creation nil))
(org-map-drill-entries
- (lambda ()
- (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*))
- (incf cnt))
- (cond
- ((not (org-drill-entry-p))
- nil) ; skip
- (t
- (when (and (not warned-about-id-creation)
- (null (org-id-get)))
- (message (concat "Creating unique IDs for items "
- "(slow, but only happens once)"))
- (sit-for 0.5)
- (setq warned-about-id-creation t))
- (org-id-get-create) ; ensure drill entry has unique ID
- (destructuring-bind (status due age)
- (org-drill-entry-status)
- (case status
- (:unscheduled
- (incf *org-drill-dormant-entry-count*))
- ;; (:tomorrow
- ;; (incf *org-drill-dormant-entry-count*)
- ;; (incf *org-drill-due-tomorrow-count*))
- (:future
- (incf *org-drill-dormant-entry-count*)
- (if (eq -1 due)
- (incf *org-drill-due-tomorrow-count*)))
- (:new
- (push (point-marker) *org-drill-new-entries*))
- (:failed
- (push (point-marker) *org-drill-failed-entries*))
- (:young
- (push (point-marker)
*org-drill-young-mature-entries*))
- (:overdue
- (push (list (point-marker) due age) overdue-data))
- (:old
- (push (point-marker) *org-drill-old-mature-entries*))
- )))))
+ 'org-map-drill-entry-function
scope drill-match)
(org-drill-order-overdue-entries overdue-data)
(setq *org-drill-overdue-entry-count*
@@ -2794,7 +2799,6 @@ values as `org-drill-scope'."
(add-to-list 'org-font-lock-extra-keywords
(first org-drill-cloze-keywords))))
-(add-hook 'org-font-lock-set-keywords-hook 'org-drill-add-cloze-fontification)
;; Can't add to org-mode-hook, because local variables won't have been loaded
;; yet.
- [nongnu] elpa/org-drill 6938a466e0 208/251: Update documentation, (continued)
- [nongnu] elpa/org-drill 6938a466e0 208/251: Update documentation, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b6a4b4f103 238/251: Merge branch 'master' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 749e012e65 216/251: Merge branch 'fix/drill-matching' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 96d7c199a0 221/251: Merge branch 'patch-1' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 35c1ce3499 248/251: Merge branch 'branweb/org-mode-version' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 7dece4a5e4 229/251: Fix org-get-tags compatability, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 0e0f7bcddd 242/251: Bump org-mode version to 9.3, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill e55415221e 249/251: Fix autoloads, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 78d3472033 246/251: add cram-mode test, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b431634c3e 018/251: Bug fix: when drill sessions span more than one file, display items in the other files correctly., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill eb370c7405 077/251: - Moved a line with side effects to earlier in the file, possibly fixing an,
ELPA Syncer <=
- [nongnu] elpa/org-drill 0184220926 150/251: Replace drill-typed-answer, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b7b295c80b 122/251: Update gitignore, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2832be1ad4 153/251: Replace more non-namespaced commands, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b0ee414c16 177/251: Fix call to removed variable, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 90d777bd55 183/251: Fix more byte compile errors, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 3c356dfc5a 179/251: Fix robot testing and reference to drill-typed-answer, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 8c36f488e2 162/251: Spanish card fixes and full test set, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 29b4faa174 190/251: Fix compat call, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill fdbbccad8c 218/251: Merge branch 'patch-2' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 4daff57b81 161/251: Replace dynamically scoped end-pos, ELPA Syncer, 2022/01/17