V2 backlinks appear eventually

If I add a org-roam file and link to it using [[roam:…]] from another file, then follow the link using org-open-at-point, in that buffer, after following the link, org-roam-buffer-toggle shows no backlinks. Eventually (an hour, maybe) org-roam-buffer-toggle will show backlinks. How can I cause baclinks to be recognized sooner?

The backlinks are added to the cache DB on saving a buffer.
Making sure that you save buffers might help; I can see backlinks immediately.
I don’t use roam: link so it might have different behaviour than id:, though…

I have all buffers saved while there are no backlinks. The roam: links eventually get changed to id links.

But, it looks like it works if I use org-store-link followed by org-insert-link and then modifying the link description.

Is that how you insert an id link and how do you follow the link?

Among files within Org-roam directory, I use org-roam-node-insert exclusively. I don’t use org-store-link either. Why do you use it before org-roam-node-insert?

To follow an ID link, either click on it by mouse or C-c C-o for org-open-at-point (it’s the default keybinding for Org).

Ah, if you mean org-roam-node-insert, that is new to me and it both creates the link and creates the file (node?) in one, which is great. Backlinks still don’t work, though. And the link looks like roam:Blah blah, even though I can see the id in the link.

If I use org-roam-insert, I get:

… .emacs.d/site-lisp/org-roam/org-roam.el failed to define function org-roam-insert

That’s the v2 branch from github.

With org-insert-link, it prompts for an id. Store link would make the id be selectable in the minibuffer.

So, something is screwed up, I guess.

yes, sorry, node-insert (fixed above).

Not sure if it creates a node and link at the same time.
Almost 100% of the times, I go like this:

  1. Create file A (node-find-file, something like that; I could use node-capture but i don’t)
  2. Write notes and save
  3. Create file B in the same way, write notes, and save
  4. In file B, node-insert A to create a link, and save

At 4, save-buffer inserts the link to DB.
File A will be able to show a backlink from file B immediately.

The message looks a bit weird to me though. I only use V2. You might have hangover code from V1? I think you are meant to keep either V1 or V2, not both at the same time. I don’t think I have org-insert-link defined in V2.

1 Like

Hmm. Things are working as expected now, starting with a new hierarchy of org roam files, using org-roam-node-insert to create a link and a new node in one step, or creating the node and then inserting the link.

org-insert-link is part of org mode, I think. I don’t think I have any v1 code hanging around.

Anyway, thanks! I learned a new way to insert links and navigate and I backlinks seem to work as expected.

1 Like

Ah, of course! Sorry that I mixing up functions. Glad it’s working for you now.