Links descriptions auto refactoring

I have a concept that keeps coming back to me, more and more often as I develop my knowledge base. I started using links to headings heavily. I use them in the way that the heading is placed in the context that it was discovered first, which helps me better relate to them in the future - I believe context is an important part of the knowledge.

Linked headings most of the time contain a single idea, but it’s not the rule. It creates situations when I have I link to these headings elsewhere, and because the nature of knowledge base is to promote continuous evolution my headings evolve us well. So I may have an idea related to Buddhism in the Emacs file, and I have a link to it in the Buddhism file - I’m fine with that.

The problem is, at the moment I change heading or link description the change is only local. I think it will cause some problems in the long run, because as long as I’m concerned there is no way to easily refactor the heading and links descriptions of all its references, but I may be wrong.

The question is, is it possible to implement a way to automatically update descriptions of every link when we edit source heading or just a single referral link or should I start using links in a different way to avoid problems in future?

I assume when we decide to change the heading we want to propagate the change to every reference, otherwise we would rather want to create a new idea from the existing one so there wouldn’t be a link anymore.

Sometimes the update makes sense. If you’ve got a link to “cats”, and then you change the title (or heading) “cats” to “cats I want to buy”, and that’s really what was in the file all along, then it’s likely that links that used to say “cats” should now say “cats I want to buy”.

But in other cases the link should not be changed, because the link describes the relationship between the target and the source, rather than simply being the title of the source.

If updating were to be automatic, I think you’d want the updater to check which of those two conditions holds, and update the link only if it used to be equal to the title of the target.

For what it’s worth if you want to disable the changing of link descriptions on title changes all together you can put the following in your config

(remove-hook 'org-roam-title-change-hook 'org-roam--update-links-on-title-change)
1 Like

This is already a feature?! How did I not notice? Is it recent? I’m still on version 1.2.0.

I confirm what @timquelch said. I found this feature in master branch. It’s amazing how you guys develop this tool!

The feature was merged with https://github.com/org-roam/org-roam/pull/1073