summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-07 12:32:24 +0300
committerThanos Apollo <[email protected]>2024-08-07 12:32:24 +0300
commit6cc777bba38e6bcb1bb55f4e633152fb7e79a528 (patch)
tree226fcb78e76b34453cffa98e51ea4c2e89c7a9bd
parent1a812fe2086fc59d25ebd3b674589c3d3c57b139 (diff)
get-note-proto: Prioritize tags over decks.
* Return deck proto value only if tags proto value is nil.
-rw-r--r--gnosis.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/gnosis.el b/gnosis.el
index 0b5cd18..0b4b37e 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2088,14 +2088,15 @@ CUSTOM-VALUES: Specify values for tags."
(apply #'cl-mapcar #'max padded-lists))))
(defun gnosis-get-note-proto (id &optional custom-tags custom-deck custom-values)
- "Return tag proto values for note ID."
+ "Return tag proto values for note ID.
+
+CUSTOM-VALUES: Custom values to be used instead.
+CUSTOM-TAGS: Custom tags to be used instead.
+CUSTOM-DECK: Custom deck to be used instead."
(let* ((deck (or custom-deck (gnosis-get-note-deck-name id)))
- (tags (or custom-tags (gnosis-get 'tags 'notes `(= id ,id))))
- (proto-values (or (delq nil (append (gnosis-get-custom-tag-values nil :proto tags custom-values)
- (list (gnosis-get-custom-deck-value deck :proto
- custom-values))))
- gnosis-algorithm-proto)))
- (gnosis-proto-max-values proto-values)))
+ (tags-proto (gnosis-get-custom-tag-values id :proto custom-tags custom-values))
+ (decks-proto (gnosis-get-custom-deck-value deck :proto custom-values)))
+ (if tags-proto (gnosis-proto-max-values tags-proto) (gnosis-proto-max-values decks-proto))))
(defun gnosis-get-note-tag-anagnosis (id &optional custom-tags custom-values)
"Return the minimum anagnosis tag value for note ID."