Org roam buffer shows the entire note instead of only links

In V2, the org-roam-buffer shows the backlinks, but each backlink shows the entire file instead of just the segment of the link.

There was an issue opened about it here roam-buffer shows full content of backlinks/reflinks · Issue #1934 · org-roam/org-roam · GitHub, but the fix does not work. Has anyone managed to fix it?

(I am working on doom emacs).

Sorry forgot to come back to it.

I use the following function to replace the standard one:

(defun org-roam-preview-get-contents (file pt)
    "Get preview content for FILE at PT."
    (save-excursion
      (org-roam-with-temp-buffer file
        (org-with-wide-buffer
         (goto-char pt)
         (let ((beg (progn (org-roam-end-of-meta-data t)
                           (point)))
               (end (progn (end-of-paragraph-text)
                           (point))))
           (string-trim (buffer-substring-no-properties beg end)))))))
3 Likes

@nobiot looking at the snippet, it looks like it only picks the first paragraph, not necessarily the paragraph containing the link.

Thank you. True! I thought I had tried start-of-paragraph-text first and seen some meta/property data in the preview – I can’t reproduce this situation now. I will stick to start-of-paragraph-text as you suggest in the GitHub issue.

1 Like