emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-context at the beginning of a link


From: Nicolas Goaziou
Subject: Re: [O] org-context at the beginning of a link
Date: Fri, 21 Nov 2014 23:37:45 +0100

Hello,

Alan Schmitt <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]