diff --git a/lisp/system-archivist.lisp b/lisp/system-archivist.lisp index f9479fe..137f4d6 100644 --- a/lisp/system-archivist.lisp +++ b/lisp/system-archivist.lisp @@ -115,23 +115,24 @@ Returns T if note was created, nil if it already exists." (when (uiop:file-exists-p filepath) (return-from archivist-create-note nil)) (handler-case - (uiop:with-output-file (s filepath :if-exists :nil) - (format s "#+TITLE: ~a~%" title) - (format s "#+FILETAGS: :atomic:note:~:[~;~{~a~^:~}~]~%" tags tags) - (format s "~%* ~a~%" title) - (format s ":PROPERTIES:~%") - (format s ":CREATED: ~a~%" (org-id-generate)) - (format s ":SOURCE: ~a~%" source-basename) - (format s ":END:~%") - (format s "~%~a~%" content) - (format s "~%* Backlinks~%") - (format s "- Source: [[file:~a][~a]]~%" source-basename - (file-namestring source-filepath))) - (log-message "ARCHIVIST: Created note ~a" (namestring filepath)) - t) - (error (c) - (log-message "ARCHIVIST: Failed to create note ~a: ~a" filepath c) - nil))) + (progn + (uiop:with-output-file (s filepath :if-exists :nil) + (format s "#+TITLE: ~a~%" title) + (format s "#+FILETAGS: :atomic:note:~:[~;~{~a~^:~}~]~%" tags tags) + (format s "~%* ~a~%" title) + (format s ":PROPERTIES:~%") + (format s ":CREATED: ~a~%" (org-id-generate)) + (format s ":SOURCE: ~a~%" source-basename) + (format s ":END:~%") + (format s "~%~a~%" content) + (format s "~%* Backlinks~%") + (format s "- Source: [[file:~a][~a]]~%" source-basename + (file-namestring source-filepath))) + (log-message "ARCHIVIST: Created note ~a" (namestring filepath)) + t) + (error (c) + (log-message "ARCHIVIST: Failed to create note ~a: ~a" filepath c) + nil)))) (defun archivist-gardener-scan () "Scans the Memex for broken file links and orphaned memory objects. diff --git a/org/system-archivist.org b/org/system-archivist.org index ed01fc5..ef357a9 100644 --- a/org/system-archivist.org +++ b/org/system-archivist.org @@ -167,23 +167,24 @@ Returns T if note was created, nil if it already exists." (when (uiop:file-exists-p filepath) (return-from archivist-create-note nil)) (handler-case - (uiop:with-output-file (s filepath :if-exists :nil) - (format s "#+TITLE: ~a~%" title) - (format s "#+FILETAGS: :atomic:note:~:[~;~{~a~^:~}~]~%" tags tags) - (format s "~%* ~a~%" title) - (format s ":PROPERTIES:~%") - (format s ":CREATED: ~a~%" (org-id-generate)) - (format s ":SOURCE: ~a~%" source-basename) - (format s ":END:~%") - (format s "~%~a~%" content) - (format s "~%* Backlinks~%") - (format s "- Source: [[file:~a][~a]]~%" source-basename - (file-namestring source-filepath))) - (log-message "ARCHIVIST: Created note ~a" (namestring filepath)) - t) - (error (c) - (log-message "ARCHIVIST: Failed to create note ~a: ~a" filepath c) - nil))) + (progn + (uiop:with-output-file (s filepath :if-exists :nil) + (format s "#+TITLE: ~a~%" title) + (format s "#+FILETAGS: :atomic:note:~:[~;~{~a~^:~}~]~%" tags tags) + (format s "~%* ~a~%" title) + (format s ":PROPERTIES:~%") + (format s ":CREATED: ~a~%" (org-id-generate)) + (format s ":SOURCE: ~a~%" source-basename) + (format s ":END:~%") + (format s "~%~a~%" content) + (format s "~%* Backlinks~%") + (format s "- Source: [[file:~a][~a]]~%" source-basename + (file-namestring source-filepath))) + (log-message "ARCHIVIST: Created note ~a" (namestring filepath)) + t) + (error (c) + (log-message "ARCHIVIST: Failed to create note ~a: ~a" filepath c) + nil)))) #+end_src #+end_src