On 2015-11-16 10:45, Rasmus <ras...@gmx.us> writes:

> Alan Schmitt <alan.schm...@polytechnique.org> writes:
>
>> Hello,
>>
>> I cannot seem to find in org.el a function that will return the
>> description part of a link. I'm probably missing it … Could someone tell
>> me if such a function exists?
>
> org-element-context on a link will give you what you want.  It lives in
> org-element, though.
>
> Something like this when point is on a link,
>
>     (let ((e (org-element-context)))
>       (buffer-substring-no-properties
>        (org-element-property :contents-begin e)
>        (org-element-property :contents-end e)))

Thank you for the suggestion. I'm already doing something similar:
#+begin_src emacs-lisp
(let ((link (org-store-link nil))
      (name (org-element-property :raw-value (org-element-at-point))))
...)
#+end_src

For some reason I was under the impression that org-element might be
overkill for this, but it works well.

Thanks again,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated November 9, 2015, Mauna Loa Obs.): 399.06 ppm

Attachment: signature.asc
Description: PGP signature

Reply via email to