diff options
| -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) |
