Harald Judt <h.j...@gmx.at> writes:

> Hi,
>
> I am using this function to copy links from the agenda to the clipboard:
>
> (defun my-copy-org-url ()
>      (interactive)
>      (let* ((link-info (assoc :link (org-context)))
> ...

org-context is ancient. It relies on org-links being fontified using
'org-link face and would fail for any non-standard link with :face link
parameter. Moreover, the return value will be different depending on
org-link-descriptive setting.

We should probably deprecate this function and encourage using
org-element-context. So, I recommend rewriting your code with
org-element-context.

> This indeed worked fine with previous versions of org, but recently started
> to fail to extract the link. Example entry to put into your agenda
> to test this:
>
> * TODO Header with [[https://orgmode.org/][Link]]
> SCHEDULED: <2021-10-06 Mi 12:00>
>
> Now the function above should extract "https://orgmode.org/";, but
> instead the text extracted is "Lin".

It seems that some of the faces were not applied together, making
next-single-property change stop early because faces are not 'eq (though
'equal). Not sure if we really need to do anything about it. It is a bad
idea to rely on next/prev-property-change in org-context anyway.

Best,
Ihor

Reply via email to