Newbie question about the difference between a link in a file and a backlink

I am trying to understand the concept of a backlink. How is a backlink in an org document different from an ordinary link? I have created a few files and linked them to other files. But when I try to see the backlinks by calling org-roam, it says “No backlinks!”

Something’s wrong with your config.

These are my settings:

 '(org-roam-db-update-method 'immediate)
 '(org-roam-directory "c:/nbwin/home/org-roam")
 '(org-roam-mode t nil (org-roam))
    (setq deft-directory "~/org-roam")
 ;;org-roam
 (setq org-roam-directory "~/org-roam")
 (add-hook 'after-init-hook 'org-roam-mode)
 (setq org-roam-dailies-capture-templates
 'org-roam-capture--get-point
 (global-set-key (kbd "<f1> n") 'org-roam-find-file)
 (global-set-key (kbd "<f1> i") 'org-roam-insert)
 (global-set-key (kbd "<f1> d") 'org-roam-dailies-capture-today)
 (global-set-key (kbd "<f1> u") 'org-roam-db-build-cache)
 (global-set-key (kbd "<f1> r") 'org-roam)
 (global-set-key (kbd "<f1> y") 'org-roam-dailies-find-yesterday)
 (global-set-key (kbd "<f1> j") 'org-roam-dailies-find-date)

You might benefit from looking at the config sample in chapter 3 of my guide. It is for Windows users but the config samples should be identical for other OSs if you do not use Emacs distros such as Doom and Spacemacs.

Looking at the excerpt of your config above, it does not do what you might intend to do. I cannot spend time to correct all, but give you two examples:

First:
'(org-roam-db-update-method 'immediate)
this does not set anything on its own. What you mean is probably this:
(setq org-roam-db-update-method 'immediate)

Second:
(setq org-roam-dailies-capture-templates 'org-roam-capture--get-point

You would need to close the parenthesis before moving on to defining keybindings. I don’t know what org-capture-get--point is intended to do, I cannot give you advice on this part.

My suggestion is to have a look at the guide, and see if you could follow some of it for your OS. If you are on Windows, at least it will help you get started.

2 Likes

To respond to your query, the ordinary link is a forward link. For example, if I have this “ordinary link” to Google.com, we can navigate to Google from this page. But Google.com does not know it is linked by this page.

Backlinks let you see from Google that this page links to it.

That’s the basic concept.

From the exchange above, I guess your intention is not really to ask about this basic concept, but ask about how to get Org-roam to work to show backlinks. So I’ll stop here. Just wanted to make sure to respond to your direct question.

1 Like

Thank you for this explanation which is really helpful. Let me play back my understanding to you to see if I am correct. If I have a file named work.org that has a link to a file named home.org. If I open home.org and check for backlinks then it should show work.org as one backlink? I.e. it is showing the file that points to it. However, I have some files which should be showing such links but are not.

I have carefully followed your excellent tutorial and have successfully installed org-roam. Thank you.

Yes. After setting up Org-roam, I am assuming this has been fixed?

If my above understanding is correct that backlinks show the files pointing to a file, then there are still some files that are not showing backlinks which should be showing them. I have refreshed the cache but it has not seemed to make any difference. Incidentally, I have been able to set up org-roam graphs which are working very well.

Some items to check

  • Both files need to be in or under org-roam-directory.

  • Save both files

  • Wait for longer than 2 seconds without touching Emacs. By default, cache updates happen after 2 seconds of idle time

  • Revert the current buffer to refresh the backlink side panel (command revert-buffer)

1 Like

I have tried your suggestions without success. I am uploading two files to illustrate.

You mentioned that some links appear correctly in the backlink side panel (org-roam buffer). What are the differences? Can you click on the link in the test file and jump to the linked file correctly?

The first screen also looks a bit strange. The backlink side panel does not show the title correctly. It should show “: SOLEMNIZE ANY MARRIAGE IN A CHURCH OR OTHER BUILDING” rather than what appears to be the file name.

1 Like

I have fixed the problem now thanks to your keen eye. It seems there was a problem with the #+title: heading (two colons) instead of one. I am very excited to have org-roam properly installed. Thank you!

2 Likes