Table of contents

DONE

Show backlinks on org-mode

functionalitytask

%3 cluster_8a51ca29_b26e_47f3_9778_bbc9d1894553 Show backlinks on org-mode cluster_ad6ca028_3235_4905_af8f_d5529ee34ce6 Existing approaches cluster_66425a7e_9d74_48d1_bfc8_4618aaa46a5a Org-backlink _1243e4e2_f11b_42e3_9009_1cd66ba2870d Org-sidebar _e3661d6a_3926_43c1_a4dc_4f414a0fb2af Org-super-links _ff496670_dc73_4c7d_9cd5_2de6fc103b3c Try to avoid (org-open-at-point) when building cache _c6bbef83_0f55_417c_afcb_ea891ace72f4 Backlinks _c6bbef83_0f55_417c_afcb_ea891ace72f4->__0:cluster_8a51ca29_b26e_47f3_9778_bbc9d1894553 _1710d269_2a39_4222_8895_e700b34d8e18 Org-mode _aa29be89_70e7_4465_91ed_361cf0ce62f2 Emacs _1710d269_2a39_4222_8895_e700b34d8e18->_aa29be89_70e7_4465_91ed_361cf0ce62f2 _9383d029_c0ff_47b7_bf38_62d08137dddc EmacsLISP _9383d029_c0ff_47b7_bf38_62d08137dddc->_aa29be89_70e7_4465_91ed_361cf0ce62f2 cluster_66425a7e_9d74_48d1_bfc8_4618aaa46a5a cluster_66425a7e_9d74_48d1_bfc8_4618aaa46a5a __1:cluster_8a51ca29_b26e_47f3_9778_bbc9d1894553->_1710d269_2a39_4222_8895_e700b34d8e18 __2:cluster_8a51ca29_b26e_47f3_9778_bbc9d1894553->_aa29be89_70e7_4465_91ed_361cf0ce62f2 __3:cluster_8a51ca29_b26e_47f3_9778_bbc9d1894553->_9383d029_c0ff_47b7_bf38_62d08137dddc

The goal is to support showing backlinks inside an Org-mode on Emacs like it is shown on the web ui.

This could be done using additional packages like gh:org-roam/org-roam, but...

As my experience with elisp is very basic, I started looking for packages that already did this...

In the end I got it working using the Org-backlink package.

Existing approaches

Org-backlink

floss

gh:codecoll/org-backlink looks like a great base, it does exactly what I want, and presents exactly how I want it... but looks like it only supports ~file:~ links, and I'd rather have id: links. No problem! The code looks really specific and readable, so it provides a great base to work on. (Note that it's GPLv3 licensed!)

This commit adds support for ID links so maybe there's no need for additional changes, maybe just grab gh:svenssonaxel/org-backlink and go with it...

With minor changes is looking good!

  • Minor fix on org-backlink-mode-expand-files

    commit 9e90b90

  • Jump to org-id, instead of jump to file and search

    commit 4c2e28a

I forked the org-backlink repo and applied these commits on gh:kenkeiras/org-backlink.

DONE

Try to avoid (org-open-at-point) when building cache

optimization

Looks like after using org-id-goto this is only needed to collect the headline path (dest (org-backlink-mode-get-heading-path-string))... 🤔 maybe this is used where the link points to, and so to on which headline to draw the backlink.

If this were true, using the ID should be enough and we could accelerate this process.

  • Applied on

    commit 87ebbcb

DISCARDED

Org-super-links

floss

gh:toshism/org-super-links might be another approach, but it looks like it edits the file it writes the backlinks onto, and that's a no-go for me.

DISCARDED

Org-sidebar

floss

If nothing else works out, gh:alphapapa/org-sidebar might be useful to have something working... but it's not ideal (requires a secondary buffer) and the backlinks don't look like they are a focus for the package, as the author points out:

[alphapapa] on [2020-11-03 Mar]

[...] Anyway, this feature is somewhat primitive and inflexible as-written. If you really need backlinks, a package like org-roam would probably work better for you. [...]