summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-07 01:39:31 +0300
committerThanos Apollo <[email protected]>2024-08-07 01:39:31 +0300
commit95fda0a8e3819f833334bbcfeda5fbe85be6dfe9 (patch)
treef2727d8fd910fb7807a8921149c6e637e34b0e2d /gnosis.el
parenta755a634eadea49829d4231d510ee8976d08f473 (diff)
New function: proto-max-values.
* To be used with get-note-proto, to return the max list of proto values.
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 84f8164..32d1438 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2085,6 +2085,17 @@ CUSTOM-VALUES: Specify values for tags."
(if (>= max-agnoia 1)
(error "Agnoia value must be lower than 1")
max-agnoia)))
+
+(defun gnosis-proto-max-values (proto-values)
+ "Return max values from PROTO-VALUES."
+ (if (not (and (listp proto-values) (cl-every #'listp proto-values)))
+ proto-values
+ (let* ((max-len (apply #'max (mapcar #'length proto-values)))
+ (padded-lists (mapcar (lambda (lst)
+ (append lst (make-list (- max-len (length lst)) 0)))
+ proto-values)))
+ (apply #'cl-mapcar #'max padded-lists))))
+
(defun gnosis-get-date-total-notes (&optional date)
"Return total notes reviewed for DATE.