From 1a812fe2086fc59d25ebd3b674589c3d3c57b139 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 7 Aug 2024 12:31:17 +0300 Subject: get-note-agnoia: Prioritize tags over decks. * get-note-tag-agnoia: Returns either nil or max agnoia value. * get-note-agnoia: Returns deck value only if tags value is nil. --- gnosis.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gnosis.el b/gnosis.el index 58206d3..0b5cd18 100644 --- a/gnosis.el +++ b/gnosis.el @@ -2060,9 +2060,7 @@ CUSTOM-VALUES: Specify values for tags." (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))) + (and agnoia-values (apply #'max agnoia-values)))) (defun gnosis-get-note-deck-agnoia (id &optional custom-deck custom-values) "Return agnoia value for note ID." @@ -2074,10 +2072,10 @@ CUSTOM-VALUES: Specify values for tags." "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) + (note-agnoia (or tag-agnoia deck-agnoia))) + (if (>= note-agnoia 1) (error "Agnoia value must be lower than 1") - max-agnoia))) + note-agnoia))) (defun gnosis-proto-max-values (proto-values) "Return max values from PROTO-VALUES." -- cgit v1.2.3