[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill ef9bad812c 112/251: Explain tags now inherit
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill ef9bad812c 112/251: Explain tags now inherit |
Date: |
Mon, 17 Jan 2022 18:59:07 -0500 (EST) |
branch: elpa/org-drill
commit ef9bad812cbd22e3fdf5e18095fb95ed9fb52384
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>
Explain tags now inherit
Previously, explanation tags were placed on the entry requiring an
entry; now they are placed on the entry providing the explanation and
inherited. It is also possible to provide multiple explanations at
several levels.
---
org-drill.el | 47 +++++++++++++++++++++++++++++++----------------
1 file changed, 31 insertions(+), 16 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index bdafb4028a..4bc8dde351 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -3687,19 +3687,32 @@ returns its return value."
;; org-drill :explain: implementations
-(defun org-drill-get-parent-entry-text ()
- "Fetch the text from the parent entry"
+(defun org-drill-get-explain-text (&optional existing-text)
+ "Fetch the explaination texts for this entry.
+
+Explaination text is found in parent entries with an :explain:
+tag. If there are multiple parents entries with such a tag, all
+of them are returned.
+
+Returns a list of strings."
(save-excursion
(save-restriction
(widen)
- (outline-up-heading 1 t)
- (org-drill-get-entry-text))))
+ (if (>= 1 (funcall outline-level))
+ existing-text
+ (outline-up-heading 1 t)
+ (if (org-drill-explain-entry-p t)
+ (org-drill-get-explain-text
+ (cons
+ (org-drill-get-entry-text)
+ existing-text))
+ existing-text)))))
(defvar org-drill-explain-overlay nil)
-(defun org-drill-explain-entry-p ()
+(defun org-drill-explain-entry-p (&optional no-inherit)
"Returns non-nil if an entry is associated with explanation"
- (member "explain" (org-get-tags nil t)))
+ (member "explain" (org-get-tags nil no-inherit)))
(defun org-drill-end-of-entry-pos ()
(save-excursion
@@ -3707,16 +3720,18 @@ returns its return value."
(point)))
(defun org-drill-explain-answer-presenter ()
- (when org-drill-explain-overlay
- (delete-overlay org-drill-explain-overlay))
- (let* ((end (org-drill-end-of-entry-pos))
- (ov (make-overlay
- end end
- (current-buffer))))
- (overlay-put ov 'after-string
- (concat "\n\nExplanation:\n\n"
- (org-drill-get-parent-entry-text)))
- (setq org-drill-explain-overlay ov)))
+ (save-excursion
+ (when org-drill-explain-overlay
+ (delete-overlay org-drill-explain-overlay))
+ (let* ((end (org-drill-end-of-entry-pos))
+ (ov (make-overlay
+ end end
+ (current-buffer))))
+ (overlay-put ov 'after-string
+ (format "\n\nExplanation:\n\n%s"
+ (mapconcat 'identity
+ (org-drill-get-explain-text) "\n\n")))
+ (setq org-drill-explain-overlay ov))))
(defun org-drill-explain-cleaner ()
(when org-drill-explain-overlay
- [nongnu] elpa/org-drill 4f8543a95e 097/251: Added tag 2.5.1 for changeset 7a8df02a7ffc, (continued)
- [nongnu] elpa/org-drill 4f8543a95e 097/251: Added tag 2.5.1 for changeset 7a8df02a7ffc, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill cda03224dc 098/251: Added new card type, "simpletyped". Instead of just pressing space to reveal, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 738b956a16 099/251: Updated version number in header., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9c86731452 086/251: During drills, pressing keys for quit, edit and skip now works again., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill fa03aa7696 087/251: Added tag 2.4.8 for changeset 080a526cc34a, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill a9d3447041 101/251: Reinstated dependency on 'org-learn' library., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 562baba885 102/251: Added tag 2.6.1 for changeset 586920548547, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d9ffa4b91f 104/251: Add support for typing in buffer input, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 45e92eca74 109/251: Add org-drill-cram-tree function, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ef79a22735 111/251: Add explain support, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ef9bad812c 112/251: Explain tags now inherit,
ELPA Syncer <=
- [nongnu] elpa/org-drill 6959903b99 113/251: Explain status of fork, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 507daae5a2 128/251: Remove org-drill-session-qualities, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 0e89d9a638 134/251: Remove more variables, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill a803289de9 137/251: Remove last of earmuff variables, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill df13d89a4c 119/251: Add interactive test functions, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d37519f54c 147/251: Clean up robot testing, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9fa9b6eabf 148/251: Robot test all card types, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 500d1475c3 120/251: Add count entries test, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill c1c57adea9 133/251: Remove dormant-entry-count, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill a923ba2c90 145/251: Move exit-kind to slot, ELPA Syncer, 2022/01/17