Org-roam: Backlinks folding levels

Created on 30 Jul 2020  路  5Comments  路  Source: org-roam/org-roam

Brief Abstract

It would be nice to be able to open the backlinks folded, showing only the two first levels (for instance).

Long Description

Backlinks show up like

* 3 Backlinks
** A
*** Top
    Backlinks on A
** B
*** Top
    Backlinks on B
** C
*** Top
    Backlinks on C

It would be nice to configure org-roam to show initially only a predetermined number of headings, like

* 3 Backlinks
** A...
** B...
** C...

Thank you very much!

Please check the following:

  • [X] No similar feature requests
enhancement side-buffer-revamp

Most helpful comment

Sounds good. It should be trivial to do with the current system, but since we're planning a full revamp of the buffer, we'll keep headline visibility in mind. Thanks!

All 5 comments

Sounds good. It should be trivial to do with the current system, but since we're planning a full revamp of the buffer, we'll keep headline visibility in mind. Thanks!

Under the current system, this can be done with:

(add-hook 'org-roam-buffer-prepare-hook
          (lambda () (org-content 2))
          :append)

where

  • org-content 2 makes Org show headings like the example given, and
  • :append makes the function run after the backlinks have been inserted

Thanks for the tip, @kisaragi-hiu, but in my setup the backlinks vanished completely. The side buffer opens empty. :-(

@cantao @kisaragi-hiu - I tried the above solution as well and ended up with the same problem. Side buffer becomes empty.

You might want to open another issue for that; I've been using it without issue.

https://gitlab.com/kisaragi-hiu/.emacs.d/-/blob/7d3fa58bd666e5bf2aedfd5753cbf0007c475a67/.emacs.d/init.el#L2262-2265

  (with-eval-after-load 'org-roam
    (add-hook 'org-roam-buffer-prepare-hook
              (lambda () (org-content 2))
              :append))
Was this page helpful?
0 / 5 - 0 ratings