[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill ff9bb0a435 138/251: Replace warned-about-id-crea
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill ff9bb0a435 138/251: Replace warned-about-id-creation |
Date: |
Mon, 17 Jan 2022 18:59:09 -0500 (EST) |
branch: elpa/org-drill
commit ff9bb0a435c5f5dd43e0ee67563c778ccc826842
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>
Replace warned-about-id-creation
This variable is not declared but dynamically scoped in everywhere.
---
org-drill.el | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index e7e46f4aa7..71b1b24f9c 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -636,7 +636,12 @@ interval was greater than ORG-DRILL-DAYS-BEFORE-OLD days.")
:initform nil
:documementation "Are we in 'cram mode', where all items are considered due
for review unless they were already reviewed in the recent past?"
- ))
+ )
+ (warned-about-id-creation
+ :initform nil
+ :documentation "Have we warned the user about ID creation this session?")
+
+ )
:documentation "An org-drill session object carries data about
the current state of a particular org-drill session." )
@@ -2946,7 +2951,7 @@ STATUS is one of the following values:
sym1)))))
-(defun org-map-drill-entry-function ()
+(defun org-map-drill-entry-function (session)
(org-drill-progress-message
(+ (length (oref session new-entries))
(length (oref session overdue-entries))
@@ -2955,7 +2960,7 @@ STATUS is one of the following values:
(length (oref session failed-entries)))
(cl-incf cnt))
(when (org-drill-entry-p)
- (org-drill-id-get-create-with-warning)
+ (org-drill-id-get-create-with-warning session )
(cl-destructuring-bind (status due age)
(org-drill-entry-status)
(cl-case status
@@ -2981,13 +2986,13 @@ STATUS is one of the following values:
))))
-(defun org-drill-id-get-create-with-warning()
- (when (and (not warned-about-id-creation)
+(defun org-drill-id-get-create-with-warning(session)
+ (when (and (not (oref session 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))
+ (setf (oref session warned-about-id-creation) t))
(org-id-get-create))
@@ -3064,10 +3069,9 @@ work correctly with older versions of org mode. Your org
mode version (%s) appea
(unwind-protect
(save-excursion
(unless resume-p
- (let ((org-trust-scanner-tags t)
- (warned-about-id-creation nil))
+ (let ((org-trust-scanner-tags t))
(org-map-drill-entries
- 'org-map-drill-entry-function
+ (apply-partially #'org-map-drill-entry-function session)
scope drill-match)
(org-drill-order-overdue-entries session overdue-data)
(setf (oref session overdue-entry-count)
@@ -3806,12 +3810,11 @@ Returns a list of strings."
(let* ((session org-drill-last-session)
(pending (org-drill-pending-entry-count session)))
(unless (cl-plusp pending)
- (let ((warned-about-id-creation nil)
- (cnt 0)
+ (let ((cnt 0)
(overdue-data nil)
(end-pos nil))
(org-map-drill-entries
- 'org-map-drill-entry-function
+ (apply-partially 'org-map-drill-entry-function session)
nil nil)))
;; if the overdue entries are not ones we have just created
(if (> (org-drill-pending-entry-count session) org-drill-leitner-completed)
@@ -3829,7 +3832,6 @@ Returns a list of strings."
(interactive)
(let ((org-drill-leitner-boxed-entries nil)
(org-drill-leitner-unboxed-entries nil)
- (warned-about-id-creation nil)
(count 0))
(org-drill-all-leitner-capture)
;; make sure we have enough (or at least the maximum number we
@@ -3913,7 +3915,7 @@ shuffling is done in place."
org-drill-leitner-unboxed-entries
(nreverse org-drill-leitner-unboxed-entries))))
-(defun org-drill-map-leitner-capture ()
+(defun org-drill-map-leitner-capture (session)
"Capture this entry if it is a valid leitner entry"
;; This bit is all rather shared with org-map-drill-entry-function
(org-drill-progress-message
@@ -3922,7 +3924,7 @@ shuffling is done in place."
;; This variable is dynamically scoped in!
(cl-incf cnt))
(when (org-drill-entry-p)
- (org-drill-id-get-create-with-warning)
+ (org-drill-id-get-create-with-warning session)
(let ((leitner-box (org-entry-get (point) "DRILL_LEITNER_BOX" nil)))
(cond
;; Entries we have not looked at yet
- [nongnu] elpa/org-drill 4daff57b81 161/251: Replace dynamically scoped end-pos, (continued)
- [nongnu] elpa/org-drill 4daff57b81 161/251: Replace dynamically scoped end-pos, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 04283a8a6c 228/251: Remove obsolete org-drill-optimal-factor-matrix, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b61865f701 219/251: Merge branch 'patch-3' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 44f66af8f7 230/251: fix argument passed to now obsoleted org-toggle-latex-fragment, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill a51c152bdb 227/251: Update documentation, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill bf8fe812d4 251/251: Update docker images, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 3f6435d39a 085/251: Added tag 2.4.7 for changeset 552ec7292154, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill f9da5ee130 232/251: Do not remove overlays after finishing card, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 4d5b9e60c8 239/251: Remove interactive from org-drill-entry-f, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill fecfc9c9a9 206/251: Add documentation, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ff9bb0a435 138/251: Replace warned-about-id-creation,
ELPA Syncer <=