org-super-links icon indicating copy to clipboard operation
org-super-links copied to clipboard

Why is org-store-link not sufficient, Why is org-super-links-store-link necessary

Open hpgisler opened this issue 3 years ago • 1 comments

This is not actually a bug - more a general issue / question I have..

Observed behavior:

  • using org-store-link is usable only for `org-insert-link'
  • using org-store-link is not usable in conjunction with org-super-links-insert-link

Expected / nice to have behavior

  • org-super-links-insert-link also accepts a link previously stored with `org-store-link'

Why would this be nice?

  • one keybinding less to remember (only org-store-link, org-super-links-store-link would not be required anymore)
  • When storing a link, I would not need decide at that moment, whether I want to insert the link later on via org-insert-link or org-super-links-insert-link, this decision would be deferred to the time when inserting the link.

hpgisler avatar Jan 29 '22 10:01 hpgisler

I think this is because the two methods internally use a different mechanism to deal with this.

On the one hand, org-store-link directly builds and stores the link and description into the org-stored-links variable and org-insert-link only reads those and inserts the link. I think this is done because it supports more than just links to org headings. On the other hand, super-links uses a register to store only the marker to which the link should be created and builds the link (and does more) later during inserting.

Maybe org-super-links-insert-link could be adapted to read the link stored by org-store-link and deconstruct it to retrieve the marker.

stefan2904 avatar Mar 08 '22 15:03 stefan2904