Ihor Radchenko <yanta...@posteo.net> writes: > Sébastien Gendre <s...@k-7.ch> writes: > >> With the Org-mode element API, when I get an element of type "link", how >> do I extract the link description ? > [...] > Link description is considered to be link contents. > But do note that simple `org-element-at-point' does not compute > contents. It is only available in the full parse tree. From > `org-element-at-point', a practical way to retrieve description text is > using substring between :contents-begin/end. > [...]
I use org-link-display-format to get the description part when I have the link as a string. Perhaps something along the lines of (org-link-display-format (buffer-substring-no-properties (org-element-contents-begin link) (org-element-contents-end link))) for your use-case? Hoping to have helped, --alexander