summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-07 01:37:14 +0300
committerThanos Apollo <[email protected]>2024-08-07 01:37:14 +0300
commit833934440394d67aafcb7e98f79621838018368f (patch)
treebb2298a6731ffb1115a97c9d32b78381bc8c61cd /gnosis.el
parent1bb2e3bdc17dca1206910ca997a1650a731c1f7d (diff)
get-note-amnesia: Add optional arguments values for testing.
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 9ef0ab5..9b30f43 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2025,6 +2025,19 @@ Optionally, use CUSTOM-DECK and CUSTOM-VALUES."
(or (gnosis-get-custom-deck-value deck :amnesia custom-values)
gnosis-algorithm-amnesia-value)))
+(defun gnosis-get-note-amnesia (id &optional custom-deck custom-tags custom-values )
+ "Return amnesia value for note ID.
+
+Note amnesia should be hte MINIMUM value of deck's & tags' amnesia.
+
+CUSTOM-TAGS: Specify tags for note id.
+CUSTOM-VALUES: Specify values for tags."
+ (let* ((deck-amnesia (gnosis-get-note-deck-amnesia id custom-deck custom-values))
+ (tags-amnesia (gnosis-get-note-tag-amnesia id custom-tags custom-values))
+ (note-amnesia (min deck-amnesia tags-amnesia)))
+ (if (>= note-amnesia 1)
+ (error "Amnesia value must be lower than 1")
+ note-amnesia)))
(defun gnosis-get-date-total-notes (&optional date)
"Return total notes reviewed for DATE.