Finding Unlinked References (org-roam-sbl-show-broken-links)

Hey all, just started using org-roam recently and I’m finding it quite fun to dink about in and try and capture useful information and thoughts so thanks all for making a cool thing and building a useful community around it.

Anyway one thing I’m liking doing in my workflow is to just drop in org-roam-insert-immediate links as I’m going, to link to stuff that either exists or I want to exist later. wotjpit interrupting my typing and drag me into another topic fully.

However I wanted something to try and find these links later. Initially I poked org-roam-unlinked-references (see the manual) but it wasn’t quite doing it for me as it was doing a grep for just the current node, so I wrote a basic broken link scanning package which is at the minute called org-roam-sbl-show-broken-links.

It currently can either scan the current open buffer or the whole database. At the minute it only checks roam: and file: links for legitimacy, it does however know how to look in an .org file and determine if its “empty” if its just headers and whitespace (i.e. has been created by org-roam-insert-immediate) and its been built to be pretty extensible for easily teaching it how to parse other link types (I also think there’s probably an easier more general method involving using org-link to follow links but I’ve not found it yet)

Anyway hope that’s useful for anyone else, feedback welcome.

1 Like

Sounds great!
Completely off tangent, but what does “sbl” stand for?

I just needed a short namespace to organise everything in, so its [S]how [B]roken [L]inks and everything should be org-roam-sbl-.* for variables and functions :slight_smile:

1 Like

Cool! Thank you :tada:

No worries.

IIRC you’re a windows user? If so I’m interested if this works smoothly for you as I’ve only really tested it on a linux box. It should be fine but you know how things are in practice :slight_smile:

Yes, I’m on Windows. Let me try sbl :grin:
I’m doing a lot of IKEA stuff this weekend (real story :rofl:) so I might need next weekend -ish to come back to the Emacs stuff. I’ll let you know.

The joy of IKEA, no worries have fun with it :slight_smile: I’m in no rush just figured I’d try and snag someone keen early on, I’ve only got around to posting about it because the plans I had to distract me from fiddling with tech stuff got derailed by having to wait fo an engineer.

Hey @twitchy-ears could you please provide the correct way to install it for windows? I downloaded and add (add-to-list 'load-path "~/.emacs.d/org-roam-sbl-show-broken-links-main/") but it doesn’t work.

Sorry to give you some bad news, this was written against Org Roam v1 and probably won’t work for Org Roam v2 (the current version), I’ve got some plans to rewrite it but life has kept me very busy (it may get done next month).

If you are running it against Org Roam v1 then you can ask your copy of emacs where it thinks ~ (which is used as a shortcut for your “home directory” on Unix systems) actually is.

Switching to a scratch buffer if you put this in and evaluate it (by putting your cursor at the end and hitting C-x C-e) it will print a message in the minibuffer

(expand-file-name "~")

For me that expands to: "c:/Users/username/AppData/Roaming" which seems consistent with https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-HOME.html

You could also use the variable user-emacs-directory which is the same directory as your emacs init file, so something like: (add-to-list 'load-path (concat user-emacs-directory "org-roam-sbl-show-broken-links-main") would probably work (I don’t really emacs on Windows so I haven’t tested this).

Thank you for your reply. I am working on v2 currently. No worries.
:wave: