From a755a634eadea49829d4231d510ee8976d08f473 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 7 Aug 2024 01:39:05 +0300 Subject: New functions: get-note-agnoia. --- gnosis.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnosis.el b/gnosis.el index 905bc5e..84f8164 100644 --- a/gnosis.el +++ b/gnosis.el @@ -2063,6 +2063,28 @@ CUSTOM-VALUES: Specify values for tags." (if (>= note-epignosis 1) (error "Epignosis value must be lower than 1") note-epignosis))) + +(defun gnosis-get-note-tag-agnoia (id &optional custom-tags custom-values) + "Return agnoia value for note ID." + (let ((agnoia-values (gnosis-get-custom-tag-values id :agnoia custom-tags custom-values))) + (if agnoia-values + (apply #'max agnoia-values) + gnosis-algorithm-agnoia-value))) + +(defun gnosis-get-note-deck-agnoia (id &optional custom-deck custom-values) + "Return agnoia value for note ID." + (let ((deck (or (gnosis-get-note-deck-name id) custom-deck))) + (or (gnosis-get-custom-deck-value deck :agnoia custom-values) + gnosis-algorithm-agnoia-value))) + +(defun gnosis-get-note-agnoia (id &optional custom-deck custom-tags custom-values) + "Return agnoia value for note ID." + (let* ((deck-agnoia (gnosis-get-note-deck-agnoia id custom-deck custom-values)) + (tag-agnoia (gnosis-get-note-tag-agnoia id custom-tags custom-values)) + (max-agnoia (max deck-agnoia tag-agnoia))) + (if (>= max-agnoia 1) + (error "Agnoia value must be lower than 1") + max-agnoia))) (defun gnosis-get-date-total-notes (&optional date) "Return total notes reviewed for DATE. -- cgit v1.2.3