diff options
| author | bard <[email protected]> | 2024-05-11 16:00:55 -0400 |
|---|---|---|
| committer | bard <[email protected]> | 2024-05-11 16:00:55 -0400 |
| commit | 9250cd4b96ed10da32d1917587b8fba4c0c63ad1 (patch) | |
| tree | b1ff3e67f4eb2ce2578449775811a379bb781305 /bin/.local | |
| parent | acbe1f7e23d0a1c21b08b5b47fbed7b0e200c510 (diff) | |
finished script
actually works, but don't know how to compile it yet
going to try rewriting in chicken scheme for now
Diffstat (limited to 'bin/.local')
| -rwxr-xr-x[-rw-r--r--] | bin/.local/bin/scripts/lisp/archive-analyzer.lisp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/bin/.local/bin/scripts/lisp/archive-analyzer.lisp b/bin/.local/bin/scripts/lisp/archive-analyzer.lisp index f4d792c..9fd39e2 100644..100755 --- 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) |
