summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-07 12:33:27 +0300
committerThanos Apollo <[email protected]>2024-08-07 12:33:27 +0300
commitc3d31ec2133021fbbeb4c5cb7eaf245459ac717c (patch)
tree28d7907e492046059279fa302055a5dd3e881410
parentde6fbabe94757f1663a809c2cb72464fc4656fd9 (diff)
get-note-lethe: Prioritize tags over decks.
* get-note-tag-lethe: Returns either nil or max lethe value. * get-note-lethe: Returns deck value only if tags value is nil.
-rw-r--r--gnosis.el22
1 files changed, 15 insertions, 7 deletions
diff --git a/gnosis.el b/gnosis.el
index cb72f01..e9d8604 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2127,23 +2127,31 @@ CUSTOM-DECK: Custom deck to be used instead."
note-anagnosis))
(defun gnosis-get-note-deck-lethe (id &optional custom-deck custom-values)
- "Return lethe deck value for note ID."
+ "Return lethe 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 :lethe custom-values)
gnosis-algorithm-lethe-value)))
(defun gnosis-get-note-tag-lethe (id &optional custom-tags custom-values)
- "Return note ID tag lethe values."
+ "Return note ID tag lethe values.
+
+CUSTOM-VALUES: Custom values to be used instead.
+CUSTOM-TAGS: Custom tags to be used instead."
(let ((lethe-values (gnosis-get-custom-tag-values id :lethe custom-tags custom-values)))
- (if lethe-values
- (apply #'min lethe-values)
- gnosis-algorithm-lethe-value)))
+ (and lethe-values (apply #'min lethe-values))))
(defun gnosis-get-note-lethe (id &optional custom-deck custom-tags custom-values)
- "Return note ID lethe value."
+ "Return note ID lethe value.
+
+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-lethe (gnosis-get-note-deck-lethe id custom-deck custom-values))
(tag-lethe (gnosis-get-note-tag-lethe id custom-tags custom-values))
- (note-lethe (min deck-lethe tag-lethe)))
+ (note-lethe (or tag-lethe deck-lethe)))
note-lethe))
(defun gnosis-get-date-total-notes (&optional date)