# How to indicate there is file-level org attachment for a node file?

**URL:** <https://org-roam.discourse.group/t/how-to-indicate-there-is-file-level-org-attachment-for-a-node-file/3034>\
**Category:** How To\
**Created:** [March 28, 2023, 7:30am UTC](https://org-roam.discourse.group/t/how-to-indicate-there-is-file-level-org-attachment-for-a-node-file/3034 "2023-03-28T07:30:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![freeemaen](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/freeemaen/32/1310_2.png) [@freeemaen](https://org-roam.discourse.group/u/freeemaen)\
**Post date:** [March 28, 2023, 7:30am UTC](https://org-roam.discourse.group/t/how-to-indicate-there-is-file-level-org-attachment-for-a-node-file/3034/1 "2023-03-28T07:30:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![swflint](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/swflint/32/1319_2.png) [@swflint](https://org-roam.discourse.group/u/swflint)\
**Post date:** [March 31, 2023, 1:04am UTC](https://org-roam.discourse.group/t/how-to-indicate-there-is-file-level-org-attachment-for-a-node-file/3034/2 "2023-03-31T01:04:57Z")

</div>

I wrote up a section for the org-roam buffer. It’s kind of rough, but  
it works decently enough. Code follows.

```plaintext
(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
