On 06/05/2021 19:41, Bastien wrote: > Fr Ml writes: > >> I have a problem with the function org-store-link it doesn't work as >> described in the documentation: >> https://orgmode.org/manual/Handling-Links.html >> "For Org files, if there is a '<>' at point, the link points >> to >> the target." > > Fixed in maint, thanks a lot for reporting this and Ihor for > confirming the bug. Bastien, unfortunately your fix caused duplication of stored links like "file:~/org/file.org::#custom_id" when point is outside of <>. Earlier #CUSTOM_ID link was stored in addition to "file:~/org/file.org::*Heading" search link. My suggestion is to revert your patch and to just reset custom-id variable when <> link is stored. Another effect or your patch, that I consider unintentional, is storing [[file:~/org/file.org::#custom_id][file:~/org/file.org::#custom_id]] instead of [[file:~/org/file.org::#custom_id][Heading]]. I prefer "original" behavior. Third patch is intended to avoid links inserted as [[target][file:~/org/file.org::target]] in the case of same file. I suppose, just [[target]] is better. Current variant looks unbalanced and misleading. Of course, you are free to skip last patch. I am confused by `org-insert-link' behavior. It inserts links like [[file:~/org/file.org::#custom_id][file:~/org/file.org::#custom_id]] without user prompt for description but [[file:~/org/file.org::#custom_id][Heading]] requires to confirm "Heading" description explicitly. I would expect that "raw" link is subject to ask user for more friendly option.