From 9250cd4b96ed10da32d1917587b8fba4c0c63ad1 Mon Sep 17 00:00:00 2001 From: bard Date: Sat, 11 May 2024 16:00:55 -0400 Subject: finished script actually works, but don't know how to compile it yet going to try rewriting in chicken scheme for now --- bin/.local/bin/scripts/lisp/archive-analyzer.lisp | 26 ++++------------------- 1 file changed, 4 insertions(+), 22 deletions(-) mode change 100644 => 100755 bin/.local/bin/scripts/lisp/archive-analyzer.lisp (limited to 'bin/.local') diff --git a/bin/.local/bin/scripts/lisp/archive-analyzer.lisp b/bin/.local/bin/scripts/lisp/archive-analyzer.lisp old mode 100644 new mode 100755 index f4d792c..9fd39e2 --- a/bin/.local/bin/scripts/lisp/archive-analyzer.lisp +++ b/bin/.local/bin/scripts/lisp/archive-analyzer.lisp @@ -1,5 +1,3 @@ -(ql:quickload "cl-ppcre") - (defvar *todo-archive-file* "~/Notes/denote/archive.org") (defun parse-todo-states (lines) @@ -23,24 +21,8 @@ (let ((lines (uiop:read-file-lines *todo-archive-file*))) (parse-todo-states lines))) -(defun parse-recent-done-items (lines) - "Parse the list of lines and return the three most recent DONE items without ** and tags." - (let ((done-items '()) - (count 0)) - (dolist (line (reverse lines)) - (when (and (search "DONE" line) (<= count 2)) - (push (subseq line 5) done-items) ; Remove the first 5 characters to remove "** DONE " - (incf count) - (when (= count 3) - (return done-items)))))) - -(defun remove-whitespace-around-tags (items) - "Remove whitespace around tags in each item." - (loop for item in items - collect (replace-regexp-in-string "\\s-*:\\(.*?\\):" ":\\1:" item))) +(defun print-count () + "Helper function for printing out the results of RETURN-COUNT" + (format nil "Stuff here: ~{~A~^, ~}" (return-count))) -(defun return-recent-done-items () - "Reads the file and returns the three most recent DONE items without ** and tags." - (let ((lines (uiop:read-file-lines *todo-archive-file*))) - (let ((done-items (parse-recent-done-items lines))) - (remove-whitespace-around-tags done-items)))) +(print-count) -- cgit v1.2.3