[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill d5c55b69f4 061/251: Any LaTeX math fragments in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill d5c55b69f4 061/251: Any LaTeX math fragments in an item will now be rendered inline (if possible) |
Date: |
Mon, 17 Jan 2022 18:59:01 -0500 (EST) |
branch: elpa/org-drill
commit d5c55b69f46c51b7439f6d79d170fb8b0f75e78f
Author: eeeickythump <devnull@localhost>
Commit: eeeickythump <devnull@localhost>
Any LaTeX math fragments in an item will now be rendered inline (if
possible)
during drill sessions. This means org-drill can now be used to memorize
maths equations. LaTeX fragments work correctly if placed inside cloze text,
i.e. between square brackets. I suggest using \(…\) to delimit fragments, as
using \[…\] may be difficult for org-drill to differentiate from cloze text.
'Cloze' overlays ([…]) are now very high priority, to ensure that any inner
overlays (such as inline LaTeX images) are not displayed during presentation
of the item.
Where dates are stored in item properties, we now use inactive rather than
active timestamps.
New command 'org-drill-relearn-item' lets you reset the repetition count for
an item, as if it was failed, without actually recording it as failed.
---
org-drill.el | 62 +++++++++++++++++++++++++-----------------------------------
1 file changed, 26 insertions(+), 36 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index 2d9dd808e9..f4821a6a7a 100644
--- 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.7
+;;; Version: 2.3.8
;;; Repository at http://bitbucket.org/eeeickythump/org-drill/
;;;
;;;
@@ -580,6 +580,12 @@ CMD is bound, or nil if it is not bound to a key."
time))
+(defun time-to-active-org-timestamp (time)
+ (format-time-string
+ (concat "<" (substring (cdr org-time-stamp-formats) 1 -1) ">")
+ time))
+
+
(defun org-map-drill-entries (func &optional scope drill-match &rest skip)
"Like `org-map-entries', but only drill entries are processed."
(let ((org-drill-scope (or scope org-drill-scope))
@@ -1328,7 +1334,7 @@ How well did you do? (0-5, ?=help, e=edit, t=tags,
q=quit)"
(sit-for 0.5)))))
(org-set-property "DRILL_LAST_QUALITY" (format "%d" quality))
(org-set-property "DRILL_LAST_REVIEWED"
- (time-to-inactive-org-timestamp (current-time))))
+ (time-to-active-org-timestamp (current-time))))
quality))
((= ch ?e)
'edit)
@@ -1480,6 +1486,7 @@ visual overlay, or with the string TEXT if it is
supplied."
(let ((ovl (make-overlay beg end)))
(overlay-put ovl 'category
'org-drill-hidden-text-overlay)
+ (overlay-put ovl 'priority 9999)
(when (stringp text)
(overlay-put ovl 'invisible nil)
(overlay-put ovl 'face 'default)
@@ -1527,6 +1534,7 @@ visual overlay, or with the string TEXT if it is
supplied."
(match-string 0))))
(overlay-put ovl 'category
'org-drill-cloze-overlay-defaults)
+ (overlay-put ovl 'priority 9999)
(when (and hint-sep-pos
(> hint-sep-pos 1))
(let ((hint (substring-no-properties
@@ -1591,6 +1599,7 @@ Note: does not actually alter the item."
(save-excursion
(outline-next-heading)
(point)))))
+ (overlay-put ovl 'priority 9999)
(overlay-put ovl 'category
'org-drill-replaced-text-overlay)
(overlay-put ovl 'display text)))))
@@ -1619,6 +1628,7 @@ Note: does not actually alter the item."
(if (= i (1- (length replacements)))
p-max
(+ p-min (* 2 i) 1))))
+ (overlay-put ovl 'priority 9999)
(overlay-put ovl 'category
'org-drill-replaced-text-overlay)
(overlay-put ovl 'display (nth i replacements)))))
@@ -1684,6 +1694,7 @@ Note: does not actually alter the item."
(with-hidden-cloze-hints
(with-hidden-cloze-text
(org-drill-hide-all-subheadings-except nil)
+ (org-preview-latex-fragment) ; overlay all LaTeX fragments with
images
(ignore-errors
(org-display-inline-images t))
(org-cycle-hide-drawers 'all)
@@ -1702,6 +1713,7 @@ Note: does not actually alter the item."
(t
(org-drill-hide-subheadings-if 'org-drill-entry-p)
(org-drill-unhide-clozed-text)
+ (org-preview-latex-fragment)
(ignore-errors
(org-display-inline-images t))
(org-cycle-hide-drawers 'all)
@@ -1719,6 +1731,7 @@ Note: does not actually alter the item."
(goto-char (nth (random* (min 2 (length drill-sections)))
drill-sections))
(org-show-subtree)))
+ (org-preview-latex-fragment)
(ignore-errors
(org-display-inline-images t))
(org-cycle-hide-drawers 'all)
@@ -1736,6 +1749,7 @@ Note: does not actually alter the item."
(save-excursion
(goto-char (nth (random* (length drill-sections)) drill-sections))
(org-show-subtree)))
+ (org-preview-latex-fragment)
(ignore-errors
(org-display-inline-images t))
(org-cycle-hide-drawers 'all)
@@ -1815,6 +1829,7 @@ items if FORCE-SHOW-FIRST or FORCE-SHOW-LAST is non-nil)."
;; while (org-pos-in-regexp (match-beginning 0)
;; org-bracket-link-regexp 1))
;; (org-drill-hide-matched-cloze-text)))))
+ (org-preview-latex-fragment)
(ignore-errors
(org-display-inline-images t))
(org-cycle-hide-drawers 'all)
@@ -1863,6 +1878,7 @@ the second to last, etc."
(incf cnt)
(if (= cnt to-hide)
(org-drill-hide-matched-cloze-text)))))))
+ (org-preview-latex-fragment)
(ignore-errors
(org-display-inline-images t))
(org-cycle-hide-drawers 'all)
@@ -1987,40 +2003,6 @@ pieces rather than one."
(org-drill-present-multicloze-hide-n -2))
-;; (defun org-drill-present-multicloze-show1 ()
-;; "Similar to `org-drill-present-multicloze-hide1', but hides all
-;; the pieces of text that are marked for cloze deletion, except for one
-;; piece which is chosen at random."
-;; (with-hidden-comments
-;; (with-hidden-cloze-hints
-;; (let ((item-end nil)
-;; (match-count 0)
-;; (body-start (or (cdr (org-get-property-block))
-;; (point))))
-;; (org-drill-hide-all-subheadings-except nil)
-;; (save-excursion
-;; (outline-next-heading)
-;; (setq item-end (point)))
-;; (save-excursion
-;; (goto-char body-start)
-;; (while (re-search-forward org-drill-cloze-regexp item-end t)
-;; (incf match-count)))
-;; (when (plusp match-count)
-;; (let ((match-to-hide (random* match-count)))
-;; (save-excursion
-;; (goto-char body-start)
-;; (dotimes (n match-count)
-;; (re-search-forward org-drill-cloze-regexp
-;; item-end t)
-;; (unless (= n match-to-hide)
-;; (org-drill-hide-matched-cloze-text))))))
-;; (org-display-inline-images t)
-;; (org-cycle-hide-drawers 'all)
-;; (prog1 (org-drill-presentation-prompt)
-;; (org-drill-hide-subheadings-if 'org-drill-entry-p)
-;; (org-drill-unhide-clozed-text))))))
-
-
(defun org-drill-present-card-using-text (question &optional answer)
"Present the string QUESTION as the only visible content of the card.
If ANSWER is supplied, set the global variable `drill-answer' to its value."
@@ -2657,6 +2639,14 @@ need reviewing. Start a new drill session? "
(message "You have finished the drill session."))))
+(defun org-drill-relearn-item ()
+ "Make the current item due for revision, and set its last interval to 0.
+Makes the item behave as if it has been failed, without actually recording a
+failure. This command can be used to 'reset' repetitions for an item."
+ (interactive)
+ (org-drill-smart-reschedule 4 0))
+
+
(defun org-drill-strip-entry-data ()
(dolist (prop org-drill-scheduling-properties)
(org-delete-property prop))
- [nongnu] elpa/org-drill 0aeff8516d 032/251: - All drill items now receive unique IDs (using the org-id module). This allows, (continued)
- [nongnu] elpa/org-drill 0aeff8516d 032/251: - All drill items now receive unique IDs (using the org-id module). This allows, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 1c77d6cf3a 041/251: Removed old doc files (renamed)., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ca5231b9b4 043/251: Cloze text is now correctly identified in items whose bodies contain [[bracketed links]]., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 8133a8c566 044/251: Added tag 2.3.3 for changeset e68b52fe88ac, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill c410f8dcb0 042/251: Added tag 2.3.2 for changeset 4e43f149ea97, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 7301c9ea71 073/251: Fixed calculation of 'org-drill-entry-days-since-creation' for cases where 'org-drill-entry-days-overdue' returns NIL., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 361aa53a14 069/251: Very overdue items are considered "lapsed" and are presented in the order they, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 612848a840 068/251: Added tag 2.4.1 for changeset 97f51d64df45, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d987e8d734 081/251: Added tag 2.5.0 for changeset 9b098bf2648d, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ec7b5a0cf0 048/251: Added tag 2.3.4 for changeset e472512f0be7, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d5c55b69f4 061/251: Any LaTeX math fragments in an item will now be rendered inline (if possible),
ELPA Syncer <=
- [nongnu] elpa/org-drill c71a218c68 074/251: Added tag 2.4.4 for changeset 0571437aa238, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill eb95d9415a 059/251: New global variable 'org-drill-match'. Now possible to specify a tags/property/, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ce1a76c6c9 076/251: Added tag 2.4.5 for changeset 69dde321b38c, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 45237da768 046/251: Added tag 2.3.3 for changeset 1b0cc92cbb6a, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill bd452b9fe1 054/251: The string which separates a hint from the rest of the contents of a cloze is, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b2f4874178 051/251: - Fixes to try and force display of images during drill sessions., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill f9b4c257af 067/251: Check that org version is >= 7.9.3f (the 'org-schedule' function in older, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill e52080c97b 047/251: New option: org-drill-sm5-initial-interval. Allows users of SM5 algorithm to adjust the first, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 8618a532c7 049/251: - Improved progress bar while collecting due items. It is no longer able to overflow, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 88de357a6c 084/251: Undo previous version change to 2.5.0. The current version is 2.4.7., ELPA Syncer, 2022/01/17