[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill e7460b6262 198/251: Regularize use of scope
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill e7460b6262 198/251: Regularize use of scope |
Date: |
Mon, 17 Jan 2022 18:59:17 -0500 (EST) |
branch: elpa/org-drill
commit e7460b6262cc8d3a1c27339cdc55969dfa03e409
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>
Regularize use of scope
---
org-drill.el | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index 19a11c0c02..00837b5efe 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -765,8 +765,7 @@ CMD is bound, or nil if it is not bound to a key."
(defun org-drill-map-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))
- (org-drill-match (or drill-match org-drill-match)))
+ (let ((org-drill-match (or drill-match org-drill-match)))
(apply 'org-map-entries func
(concat "+" org-drill-question-tag
(if (and (stringp org-drill-match)
@@ -777,14 +776,20 @@ CMD is bound, or nil if it is not bound to a key."
skip)))
(defun org-drill-current-scope (scope)
- (cl-case scope
- (file nil)
- (file-no-restriction 'file)
- (directory
- (directory-files
- (file-name-directory (buffer-file-name))
- t "^[^.].*\\.org$"))
- (t scope)))
+ "Translate SCOPE into an scope suitable for `org-map-entries'.
+
+If scope is NIL, then use `org-drill-scope'.
+
+Returns scope as defined by `org-map-entries'"
+ (let ((scope (or scope org-drill-scope)))
+ (cl-case scope
+ (file nil)
+ (file-no-restriction 'file)
+ (directory
+ (directory-files
+ (file-name-directory (buffer-file-name))
+ t "^[^.].*\\.org$"))
+ (t scope))))
(defmacro org-drill-with-hidden-cloze-text (&rest body)
`(progn
@@ -3787,10 +3792,9 @@ shuffling is done in place."
(defun org-drill-map-leitner (func &optional scope)
"Return all entries marked with leitner tag."
- (let ((scope (or scope org-drill-scope)))
- (org-map-entries
- func (concat "+" "leitner")
- (org-drill-current-scope scope))))
+ (org-map-entries
+ func (concat "+" "leitner")
+ (org-drill-current-scope scope)))
(defun org-drill-all-leitner-capture (&optional scope)
"Capture all items marked with a leitner tag"
@@ -3959,7 +3963,7 @@ shuffling is done in place."
(org-drill-map-entries
(lambda ()
(setq number-drill-entries (+ 1 number-drill-entries)))
- org-drill-scope nil)
+ nil nil)
(message "There are %s drill entries\nThere are %s leitner entries\nA
total of %s entries."
number-drill-entries
(+ (length org-drill-leitner-boxed-entries)
- [nongnu] elpa/org-drill 355c3a602f 108/251: Merge fix/do-not-match-lockfile, (continued)
- [nongnu] elpa/org-drill 355c3a602f 108/251: Merge fix/do-not-match-lockfile, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 5e05755fdf 118/251: Update load-test name, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d2591c4676 116/251: Dependency clean ups, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 72c774b55d 149/251: Rename free-marker into namespace, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 68d1e33e03 135/251: Replace overdue-entries, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 5bc955b066 140/251: Remove overdue-data dynamic scoping, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill a45d80654e 144/251: Tweak Robot testing, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 0239ffd27a 160/251: Remove unused definitions, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ac7ca1346f 185/251: Complete clean of byte compile messages, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill f72d8adda3 180/251: Extend README, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill e7460b6262 198/251: Regularize use of scope,
ELPA Syncer <=
- [nongnu] elpa/org-drill b0a376b3ed 203/251: Ignore created elpa directory, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 3cf59ccba6 226/251: Update documentation, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ecf4bae5ce 237/251: Fix typo "Eaqch" to "Each", ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 64d878afe3 212/251: Update README's installation instructions, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill fca357cad8 220/251: Add blank line between authors in README, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill f5b7472de1 204/251: Remove unused variable, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 4307a3a387 233/251: Show latex overlays in simple card's answer, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2d7ea5d00b 245/251: add helper fn to check cards without killing emacs, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill fee727e76e 023/251: Added tag 2.0 for changeset 16cafa21aef0, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 8b72dfbded 024/251: - Can now resume drill sessions after exiting with (e)dit or (q)uit commands!, ELPA Syncer, 2022/01/17