Hello, Alan Schmitt <alan.schm...@polytechnique.org> writes:
> I'm using a function that relies on `org-element-link-parser'. According > to the documentation, the point needs to be at the element of the link > for it to work. Not what you are asking for, but it is probably wrong to call this function directly. If you want to parse something, it's better to use `org-element-context' (or `org-element-at-point' but it doesn't fit here). > I wrote a small function that takes me to the beginning > of a link, but it fails when the point is already at the beginning of > the link. Here is a reproducible recipe showing the problem. > > Open this attached tiny org file: > Start > > [[file:link.org][link]] > > End > > Put the point on the 'i' of "link", for instance by (goto-char 26). > > Look up the context: (org-context). I get ((:link 8 31)) > > Go to the beginning of the link: (goto-char 8) > > Look up the context: (org-context). I get ((:link nil 31)) > > Is there a reason why the context is different at the beginning of the > link? I don't know, but `org-context' is very different from `org-element-context'. You probably mean to use the latter. Regards, -- Nicolas Goaziou