summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-07-23 18:41:16 +0300
committerThanos Apollo <[email protected]>2024-07-23 18:41:16 +0300
commitb0eafe453cab365d1d3d5d534289eba9bfd2b46c (patch)
tree439d952bf562a22da59b7b40a659000d7892fad7 /gnosis.el
parentd3ec1ab2ca0c3bec8a14626968a50b58a6dac0d9 (diff)
Rewrite review-increment-activity-log
* Adjust for adding new notes on reviewed-new column * Use new variable names * Rewrite more cleanly.
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/gnosis.el b/gnosis.el
index ed45621..1435a3b 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1614,12 +1614,17 @@ If user-input is equal to CLOZE, return t."
(gnosis-display-next-review id success)
success))
-(defun gnosis-review-increment-activity-log (&optional date)
- "Increament activity log for DATE by one."
- (let* ((current-value (gnosis-get-date-total-notes))
- (new-value (cl-incf current-value))
+(defun gnosis-review-increment-activity-log (new? &optional date)
+ "Increament activity log for DATE by one.
+
+If NEW? is non-nil, increment new notes log by 1."
+ (let* ((current-total-value (gnosis-get-date-total-notes))
+ (inc-total (cl-incf current-total-value))
+ (current-new-value (gnosis-get-date-new-notes))
+ (inc-new (cl-incf current-new-value))
(date (or date (gnosis-algorithm-date))))
- (gnosis-update 'activity-log `(= note-num ,new-value) `(= date ',date))))
+ (gnosis-update 'activity-log `(= reviewed-total ,inc-total) `(= date ',date))
+ (and new? (gnosis-update 'activity-log `(= reviewed-new ,inc-new) `(= date ',date)))))
(defun gnosis-review-note (id &optional date)
"Start review for note with value of id ID, if note is unsuspended.