Creating and capturing nonexistant nodes

hey, I’m pretty new to emacs, but I really like org-roam so far.

Something I wanna have though is the ability to make fake links to nonexistent
nodes I know I wanna make but don’t wanna capture just yet into a template and
interrupt my writing.

Org-roam-ui already seems to detect when I manually put in [[id:fake node]]
with empty nodes showing up in the web ui.

I even made my own function to make my fake node for me:

https://paste.sr.ht/~acsqdotme/3c83a5d01bb6d295b8a937e43bca7267768e4bb8

And I found someone on github wanting to replicate a similar workflow to me,
and jethro made them a hook to capture those fake nodes at point when running
org-open-at-point:

But when I run C-c C-o on that link and capture it, it doesn’t update the id: I
made to the generated ID, so it stays [[id:fake node][FAKE NODE]] instead of
becoming [[id:137fe61e-9b8f-4fac-a3b3-945d41721d4a][FAKE NODE]]

So my main question is with the given hook, is it possible to make a
fake-node-insert func that updates the ID automatically when captured?

Secondly and much less importantly, is there a better system than all caps to
visually signify a link goes to nowhere? dokuwiki red links are what I’m very
used to.

thanks for reading.

How about using [[roam:<Title>]] links for this purpose?

You can use completion-at-point (such as Corfu and Company – below I use Corfu).
image

With it:

  1. On save, if the title exists as a node in your org-roam-directory, the whole link automatically changes to the normal ID link.

  2. On save, If it does not exist, it will remain as roam: link.

  3. As you can change the face of the roam like this (as shown in the screen capture):

    (org-link-set-parameters "roam" :follow #'org-roam-link-follow-link :face 'nobreak-space)
  1. When you follow the roam: link, you get a capture process.
1 Like

This is great! The one thing I had to change was remove the :follow directive as C-c C-o’ing on the link didn’t work at all till I removed it.

Saving is also a bit finicky when I refile, but I’m sure I can fix that myself with a more thorough refile hook. Thanks for the help, @nobiot.

Glad it works for you :slight_smile:

This is unexpected because :follow part is what org-roam does by default. Perhaps this could be an indication that you might have customization that conflicts with this part?

You might like to check user option org-roam-link-auto-replace – I think it needs to be t (it should be, by default).

It now works now with the :follow property as well. I saw the default line in the org-roam repo, and I was confused too.

Removing it worked then, and it still works now (probably cause it doesn’t get overridden from the default?).

I cut down a lot on some global config options regarding functions, so there must’ve been one that broke it when I tried to override the property.

1 Like