Why do I now get an "org-roam-fontification-buffer" whenever I open a backlinks buffer?

I suddenly noticed that whenever I open a backlinks buffer (C-c n l) it now creates a buffer called “org-roam-fontification-buffer”. I don’t remember org-roam doing this before. The buffer created has the full text of the last backlink, but just that linked-to section; it doesn’t have the text of any other links.

I have not changed my configuration in ages. All I have done is regular updates of org roam. Is this new behavior or did I just not notice it before? Apologies if the latter. It just seems a bit inconvenient to have an extra buffer to close, plus I thought maybe something was wrong with my set up.

Thanks for any help!

GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-04-01, modified by Debian

org-roam-20251125.729

Org roam config from init.el:

(use-package org-roam
:ensure t
:custom
(org-roam-directory (file-truename “/home/john/Documents/Notes/Book”))
:bind ((“C-c n l” . org-roam-buffer-toggle)
(“C-c n f” . org-roam-node-find)
(“C-c n g” . org-roam-graph)
(“C-c n i” . org-roam-node-insert)
(“C-c n c” . org-roam-capture)
;; Dailies
(“C-c n j” . org-roam-dailies-capture-today))
:config
;; If you’re using a vertical completion framework, you might want a more informative completion interface
(setq org-roam-node-display-template (concat "${title:*} " (propertize “${tags:10}” 'face 'org-tag)))
(org-roam-db-autosync-mode)
(add-to-list 'magit-section-initial-visibility-alist (cons 'org-roam-node-section 'hide))
;; If using org-roam-protocol
(require 'org-roam-protocol))

I have a feeling that it is a program issue, not your set up. The function org-roam-fontify-like-in-org-mode creates this buffer, but perhaps it is meant to be deleted after fortification and is not done so properly — I feel that it might have been a result of recent refactoring.

I suggest you raise an issue in the project.

Thanks so much for replying. I did seem to just start noticing that buffer, so what you’re saying makes sense that it was something introduced in recent refactoring. I will do as you suggest and raise an issue over at github.

Thanks again

Probably a result of (fix): improve org-roam buffer fontification speed #1853 by kadircancetin · Pull Request #2340 · org-roam/org-roam · GitHub

It just seems a bit inconvenient to have an extra buffer to close

Most users don’t manage their Emacs sessions by going through every buffer to close. Emacs warns you about unsaved file-visiting buffers and running processes, so it’s generally easiest to let other buffers accumulate in the background.

That said, it should probably be named with a leading space to hide it from user-facing buffer list commands, which we could do an issue and PR for.

(defun org-roam–cleanup-fontification-buffer (&rest _)
(when-let ((buf (get-buffer org-roam-fontification-buffer)))
(kill-buffer buf)))

(advice-add 'org-roam-fontify-like-in-org-mode
:after #'org-roam–cleanup-fontification-buffer)

Raise an issue - in the meantime I believe this will solve your problem. Haven’t tested - but I think it would work,

Thanks for your reply and explaining there’s no harm just leaving buffers open. (I may only care because of OCD - like a sock hanging out of a drawer). And thanks for suggesting a possible future PR. I appreciate the work you guys do on this great package.

1 Like

Thanks for this. I tried it and it works! Great!

While I will still go ahead and raise an issue, I see that it is obviously a minor thing only for users with mild OCD who don’t like buffer clutter! But I appreciate your taking the time and trouble to write that function for me. Very cool. Elisp unfortunately is still Greek to me, but I may do a help function search on your snippet to try to educate myself. Thanks!