From 95fda0a8e3819f833334bbcfeda5fbe85be6dfe9 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 7 Aug 2024 01:39:31 +0300 Subject: New function: proto-max-values. * To be used with get-note-proto, to return the max list of proto values. --- gnosis.el | 11 +++++++++++ 1 file changed, 11 insertions(+) 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. -- cgit v1.2.3