diff options
author | Thanos Apollo <[email protected]> | 2024-07-23 18:41:16 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-07-23 18:41:16 +0300 |
commit | b0eafe453cab365d1d3d5d534289eba9bfd2b46c (patch) | |
tree | 439d952bf562a22da59b7b40a659000d7892fad7 /gnosis.el | |
parent | d3ec1ab2ca0c3bec8a14626968a50b58a6dac0d9 (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.el | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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. |