Recently migrate to v2
And after fixing some config issues on Emacs it is working. However, there is an issue I haven’t been able to fix:
On v1 when I clicked a link and I had the roam buffer opened it automagically updated to show the back links of a the buffer.
On v2 however, the following things happen:
When I click a from the buffer I am seeing (and org-roam-buffer is open) the org-roam-buffer does not get updated. I have to manually close it and open it again in order for it to get refreshed.
If I click a buffer on org-roam-buffer it does not take me to the buffer (I just get the message “Mark Set”), only when I click enter the links offer.
And even when it happens, the buffer window does not get replaced, instead, a split window is open (this might be a Doom Emacs thingy).
Refer to The Org-roam Buffer section of the user manual. It sounds like you are using org-roam-buffer-display-dedicated. If you are using org-roam-buffer-toggle and see the behaviour you report, something is not working properly.
Mouse click is not set up by default. See this part of the wiki. Or use keyboard RET.
Refer to the bullet points below for built-in Emacs way with display-buffer.
Variable pop-up-windows
I believe it remains in recent Emacs versions for backward compatibility. I don’t know if it influences Doom
Variable display-buffer-base-action. It’s a list functions to control the display-buffer function, which Org-roam also uses (not directly but internally). It seems to be the more recent way replacing pop-up-windows above. It’s a list ordered by preference, and I set it to this:
With this, my Org-roam buffer behaves as you would like it to (replacing an existing “main” window, not popping up a new window). I don’t know if Doom has any influence on it.
Doom’s own pop-up windows management called popup
As far as I have seen on this forum, it does not interfere with display-buffer in the context of Org-roam
Blockquote Refer to The Org-roam Buffer section of the user manual. It sounds like you are using org-roam-buffer-display-dedicated . If you are using org-roam-buffer-toggle and see the behaviour you report, something is not working properly.
I am using org-roam-buffer-toggle indeed… :(. For some reason the variable org-roam-buffer-current-node never gets updated - maybe doom is opening the windows in unexpected manner. I do not know - I wonder how roam “knows” which buffer I am seeing,.
Variable display-buffer-base-action . It’s a list functions to control the display-buffer function, which Org-roam also uses (not directly but internally). It seems to be the more recent way replacing pop-up-windows above. It’s a list ordered by preference, and I set it to this: ((display-buffer-reuse-window display-buffer-use-some-window)) With this, my Org-roam buffer behaves as you would like it to (replacing an existing “main” window, not popping up a new window). I don’t know if Doom has any influence on it.
This fixed the issue! thanks a lot. Now it works as expected. However, the roam buffer still does not get updated
I think a common issue for this is either you are not visiting an Org-roam file, or db-autosync-mode is not enabled.
Your cursor needs to be in a file within org-roam-directory. Check post-command-hook variable; it needs to contain (org-roam-buffer--redisplay-h t). That’s how Org-roam “knows” which buffer you are seeing.
It should be set up when you enable org-roam-db-autosync-mode (in your case, when your init runs org-roam-db-autosync-enable).
If you suspect Doom is doing something, perhaps toggle-debug-on-error may help.
I think a common issue for this is either you are not visiting an Org-roam file, or db-autosync-mode is not enabled.
Your cursor needs to be in a file within org-roam-directory . Check post-command-hook variable; it needs to contain (org-roam-buffer--redisplay-h t) . That’s how Org-roam “knows” which buffer you are seeing.
It should be set up when you enable org-roam-db-autosync-mode (in your case, when your init runs org-roam-db-autosync-enable ).
If you suspect Doom is doing something, perhaps toggle-debug-on-error may help.
I checked it and it is enbled however the post-command-hook is not set.
However I manually appended to it and still did not work. toggle-on-error does not show anything.
My config is very simple (besides what Doom does internally for org-roam).
I’m sorry that Doom is too complex for me to help its users properly. I only use the vanilla with my own configuration and I can’t reproduce your situation.
Mine has been working without any problem – the only reason I have traced these internal mechanisms is that I also maintain my own plug-in – I’m describing what should be by looking at the Org-roam code.
post-command-hook should be set local, so if you “manually appended to it” you would need to do this for every file when you opened it.
Manual won’t be practical, so this is done by org-roam-find-file-hook globally. Mine is set to this value:
See the first value org-roam-buffer--setup-redisplay-h.
Your problem could be that when you enabled db-sync, you already had some Org files from Org-roam open – this means they wouldn’t get “setup-redisplay-h” until you do “find-file” again.
If this does not yield any clue, you would probably need to describe exactly how you get to the situation, from launching, enabling db-autosync, find-file (or org-roam-node-fide), open org-roam-buffer (which command?), etc. etc.
There are many Doom users on this forum using Org-roam with no issue – including the author Jethro himself. So there must be an easy path to solution…
I thought it might be related to the file structure or path I did experiment by changing the location org the roam files.
I basically moved just a small subset of the files into another directory, removed the db and orgids files and started emacs and it works as expected.
The issue seems to be that the org-files / org-roam-files location was a symbolic link instead of a real directory and this might have confused roam… because once I changed it back to direct path it worked as expected
I was using the link to use the same path across different machines (two Macs and one Linux).