diff options
author | Thanos Apollo <[email protected]> | 2024-08-06 23:53:45 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-08-06 23:53:45 +0300 |
commit | 1c2b2c4e41005e126e81aa73018d00c8004133dc (patch) | |
tree | b092a002a5eaaaa9898a3e5f4a09773412e75816 | |
parent | 9ad5793b12a1195878113337c117461c929dcfb2 (diff) |
New function: get-custom-tag-values
* Return custom tag values.
-rw-r--r-- | gnosis.el | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1995,6 +1995,15 @@ VALUES: Defaults to `gnosis-custom-values'." "Return custom VALUE for note DECK." (plist-get (gnosis-get-custom-values :deck deck values) value)) +(defun gnosis-get-custom-tag-values (id keyword &optional custom-tags custom-values) + "Return KEYWORD values for note ID." + (cl-assert (keywordp keyword) nil "keyword must be a keyword!") + (let ((tags (if id (gnosis-get 'tags 'notes `(= id ,id)) custom-tags))) + (cl-loop for tag in tags + ;; Only collect non-nil values + when (plist-get (gnosis-get-custom-values :tag tag custom-values) keyword) + collect (plist-get (gnosis-get-custom-values :tag tag custom-values) keyword)))) + (defun gnosis-get-date-total-notes (&optional date) "Return total notes reviewed for DATE. |