org-transclusion icon indicating copy to clipboard operation
org-transclusion copied to clipboard

Minor mode for transcluding all the links

Open Ypot opened this issue 3 years ago • 4 comments

I think it would be interesting a "minor mode" where every ID link is seen transcluded.

For example: [[id:20210501T171427.051019][Bertrand Russell]]

Would be seen as: Bertrand Russell - Wikipedia

It will make links human readable, even without descriptions. Link descriptions don't need to be outdated anymore: When a headline is changed, the transcluded link will be updated too.

Ypot avatar Jan 05 '22 18:01 Ypot

@Ypot

every ID link is seen transcluded

Could you explain what this means a little more, please?

In normal Org mode,

[[id:20210501T171427.051019][Bertrand Russell]]

can be rendered as

Bertrand Russell

with using org-toggle-link-display.

What's the difference between this Org built-in function and your suggested minor mode?

nobiot avatar Jan 06 '22 16:01 nobiot

Hi, nobiot. I will try to explain:

Let's say we have a document from some months ago, like this one (everything is correct):

1.jpg

After some months, the headlines have changed, and the descriptions in the links are obsolete:

2.jpg

A minor mode that transcludes all the headlines would make the link descriptions always updated, like this (everything is correct again):

optimized.jpg

Ypot avatar Jan 06 '22 17:01 Ypot

Thank you. I see; now it's clear.

Hmmm... To be honest, I'm not a fan of automatically updating link descriptions. I often link to another file with a description that is completely different to the title of the other file, and it's deliberate. It's probably the majority of the cases for me.

So... If I were to design such a feature, it would need to let the user specify when to sync and when not to per link. How would you do this? Perhaps something like: [[file:another-file.org][:sync:]]. :sync: would indicate that I would like the description to be synced with the link target.

A couple of more things:

  • What should :sync: be synced? Is it #+title:, or the headline title?
  • What should happen if the target link does not have a title? Should it fall back on the file name, or just display :sync:?
  • How does the user know it has :sync: when it's covered up by the title? Perhaps when org-toggle-link-display is on, remove the "transclusion" and show :sync:?

Thinking along these lines, I feel that this feature does not share any part with the current implementation of Org-transclusion, so it would be a completely separate feature set.

I'd welcome further thoughts...

nobiot avatar Jan 06 '22 20:01 nobiot

I thought it could be a low-hanging fruit.

So... If I were to design such a feature, it would need to let the user specify when to sync and when not to per link. How would you do this? Perhaps something like: [[file:another-file.org][:sync:]]. :sync: would indicate that I would like the description to be synced with the link target.

Because of that I was thinking about a new minor mode: every link would be updated. No tags, just automatic link updates.

  • In my mind link descriptions would be synced with the headlines.
  • Headlines must exist, titles not necessarily. The target could always be a headline.
  • It would be a different minor mode than org-transclusion-mode. There should be no conflict.

I thought this could be a powerful tool, kind of smart or dynamic link descriptions. But if it's not easy, as I thought, it doesn't matter, org-transclusion is already impressive. I am sure it will be an essential tool for a lot of workflows. Thanks

Ypot avatar Jan 06 '22 20:01 Ypot