diff options
author | Thanos Apollo <[email protected]> | 2024-08-07 12:33:05 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-08-07 12:33:05 +0300 |
commit | de6fbabe94757f1663a809c2cb72464fc4656fd9 (patch) | |
tree | 18d5267b8bcf4e39b78df59cd307e69c1fb95688 /gnosis.el | |
parent | 6cc777bba38e6bcb1bb55f4e633152fb7e79a528 (diff) |
get-note-anagnosis: Prioritize tags over decks.
* get-note-tag-anagnosis: Returns either nil or max anagnosis value.
* get-note-anagnosis: Returns deck value only if tags value is nil.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -2099,23 +2099,31 @@ CUSTOM-DECK: Custom deck to be used instead." (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." + "Return the minimum anagnosis tag value for note ID. + +CUSTOM-VALUES: Custom values to be used instead. +CUSTOM-TAGS: Custom tags to be used instead." (let ((anagnosis-values (gnosis-get-custom-tag-values id :anagnosis custom-tags custom-values))) - (if anagnosis-values - (apply #'min anagnosis-values) - gnosis-algorithm-anagnosis-value))) + (and anagnosis-values (apply #'min anagnosis-values)))) (defun gnosis-get-note-deck-anagnosis (id &optional custom-deck custom-values) - "Return anagnosis deck value for note ID." + "Return anagnosis deck value for note ID. + +CUSTOM-VALUES: Custom values to be used instead. +CUSTOM-DECK: Custom deck to be used instead." (let ((deck (or (gnosis-get-note-deck-name id) custom-deck))) (or (gnosis-get-custom-deck-value deck :anagnosis custom-values) gnosis-algorithm-anagnosis-value))) (defun gnosis-get-note-anagnosis (id &optional custom-deck custom-tags custom-values) - "Return minimum anagnosis value for note ID." + "Return minimum anagnosis value 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-anagnosis (gnosis-get-note-deck-anagnosis id custom-deck custom-values)) (tag-anagnosis (gnosis-get-note-tag-anagnosis id custom-tags custom-values)) - (note-anagnosis (min deck-anagnosis tag-anagnosis))) + (note-anagnosis (or tag-anagnosis deck-anagnosis))) note-anagnosis)) (defun gnosis-get-note-deck-lethe (id &optional custom-deck custom-values) |