nobiot via Org-roam orgroam@discoursemail.com writes:
By the looks of it, Nroam avoids the backlink section in the note to be saved to the file. This is done with before-save
and after-save
hooks. org-roam-buffer-prepare-hook
might be able to insert the backlink section, but I don’t think it can be used to remove the section just before save-buffer
to avoid the section to be saved in the file. I think that’s what @NicolasPetton is saying.
@konubinix
It seems that you are saying something at a different level, but perhaps it was not clear (not exactly clear to me, at least).
I agree that there are 2 dimensions in this conversation. Actually, I
can see 3 dimensions.
- nroam plays nicely with the saving mechanism to avoid saving the
added content to the file
- nroam generate different content than org-roam
- nroam generate the content at the bottom of the buffer instead of in
a side window
About 1., I did not take a close look at how it does this, but whatever
content you insert, nroam makes sure it won’t be saved.
For instance, I replace (seq-do #'nroam–insert-backlink-group groups)
by (insert “test”) in nroam–insert-backlinks and got “test” inserted
instead of the backlinks. Replacing it with (run-hooks
org-roam-buffer-prepare-hook), it get the content of the org-roam buffer
and still the content is not saved in the file.
About 2. according to the other answer from @NicolasPetton, I understand
that there is a divergence of opinions. While org-roam only show few
information about the backlink, nroam shows the whole subtree.
I understand and respect that decision.
My point is more that I believe that 2 and 3 are independent. I think
that whatever the content generated, some people might prefer to have it
in org-roam buffer and other people in the bottom of the buffer. But I
don’t think that those people might want different content depending on
the use case.
For instance, I like:
- the way nroam generate the backlinks
- the fact that org-roam generates ref links
- the generation of those in the bottom of the buffer
But some people might prefer for instance nroam styled backlinks in the
org-roam buffer.
I don’t see why it would not be technically feasible, even though I
understand the argument that we don’t have time to write the code to do
this.
In conclusion, I think that ideally, nroam and org-roam could have the
same basis to fill the backlink section. I assumed
org-roam-buffer-prepare-hook was a good candidate, but I’m likely to be
wrong.
Using this common basis, one user could decide what content to put in
the backlink section according to their preferences, like (setq
org-roam-buffer-prepare-hook '(nroam-insert-title nroam-insert-backlinks
org-roam-buffer–insert-ref-links)).
Then, the user would decide to put this content in the org-roam buffer
with M-x org-roam or at the bottom of the buffer with M-x nroam-mode.
I hope it is clearer now. Again, I’m just sharing my thoughts and
totally don’t ask for anything.