I find myself often forgetting there is attachment to a note, as there is no cosmetic indicator about attachment. What is best way to customize it? I am thinking about changing the mode-line color conditionally by checking org-attach-dir
. Is there a better way? And how to dynamically set mode-line face in the local buffer?
I wrote up a section for the org-roam buffer. It’s kind of rough, but
it works decently enough. Code follows.
(defun org-roam-show-attachments (node)
(when-let ((id (org-roam-node-id node))
(folder (org-attach-dir-from-id id t))
(attached-files (org-attach-file-list folder)))
(magit-insert-section (org-roam-show-attachments)
(magit-insert-heading "Attached Files")
(dolist (file attached-files)
(insert (org-roam-fontify-like-in-org-mode
(format " - [[file:%s/%s][%s]]\n" folder file file))))
(insert "\n"))))
HTH,
Sam