summaryrefslogtreecommitdiff
path: root/src/gizmo/wasp-dna.el
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-04-26 23:47:18 -0400
committerLLLL Colonq <llll@colonq>2026-04-26 23:47:18 -0400
commit75e005e81b73d8471f16dc5fad7bbdc312bdbfe7 (patch)
tree1ad7d61b04c44fc52b453aef44868a42012f3551 /src/gizmo/wasp-dna.el
parentcf266a56f30daae8b9af7c9bc3267c61b1973192 (diff)
Diffstat (limited to 'src/gizmo/wasp-dna.el')
-rw-r--r--src/gizmo/wasp-dna.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gizmo/wasp-dna.el b/src/gizmo/wasp-dna.el
index 5c8f19a5..d3e0ef81 100644
--- a/src/gizmo/wasp-dna.el
+++ b/src/gizmo/wasp-dna.el
@@ -23,12 +23,16 @@
"Return the paths of every log file."
(--filter (s-matches? (rx "log-" (+ digit) "-" (+ digit) "-" (+ digit) ".txt") it) (f-files "~/logs")))
+(defvar w/dna-log-cache nil)
(defun w/dna-complete-log ()
"Return a complete log of every historical message."
- (let* ((paths (w/dna-get-all-log-paths))
- (logstr (apply #'s-concat (-map #'w/slurp paths)))
- (log (--map (w/list-to-pair (s-split ": " it)) (-non-nil (--map (cadr (s-split "\t" it)) (s-lines logstr))))))
- log))
+ (or
+ w/dna-log-cache
+ (let* ((paths (w/dna-get-all-log-paths))
+ (logstr (apply #'s-concat (-map #'w/slurp paths)))
+ (log (--map (w/list-to-pair (s-split ": " it)) (-non-nil (--map (cadr (s-split "\t" it)) (s-lines logstr))))))
+ (setf w/dna-log-cache log)
+ log)))
(defun w/dna-user-log (user)
"Return a complete log of every message sent by USER."