Does this feature exist in Emacs orgmode core?
Yes
Orgmode link
org-link-file-path-type in ol.el - controls whether links created via org-store-link use relative or absolute file paths.
Additional context
org_store_link and get_link() always produce absolute file paths:
[[file:/home/user/notes/work.org::*My headline][My headline]]
Emacs has org-link-file-path-type to control this:
| Value |
Behavior |
adaptive (default) |
Relative for same/sub dirs, absolute otherwise |
relative |
Always relative to current file |
absolute |
Absolute with ~/ |
So linking between files in the same directory would give [[file:work.org::*My headline]] instead.
Back when we fixed relative link navigation (#583), we only covered the reading side. The writing side behind org_store_link still hardcodes absolute paths. A small helper in links/init.lua could apply the configured format before building the file: link.
I would like to have this for telescope-orgmode's insert-link. I could work around it downstream, but since it's part of Emacs orgmode core it makes sense to have it here. Happy to do a PR.
Does this feature exist in Emacs orgmode core?
Yes
Orgmode link
org-link-file-path-typein ol.el - controls whether links created viaorg-store-linkuse relative or absolute file paths.Additional context
org_store_linkandget_link()always produce absolute file paths:Emacs has
org-link-file-path-typeto control this:adaptive(default)relativeabsolute~/So linking between files in the same directory would give
[[file:work.org::*My headline]]instead.Back when we fixed relative link navigation (#583), we only covered the reading side. The writing side behind
org_store_linkstill hardcodes absolute paths. A small helper inlinks/init.luacould apply the configured format before building thefile:link.I would like to have this for telescope-orgmode's insert-link. I could work around it downstream, but since it's part of Emacs orgmode core it makes sense to have it here. Happy to do a PR.