On Sat, 14 Aug 2021 at 07:48, John Kitchin wrote:
> I would probably do it like this:
>
Thanks for the help! I just found this question at Emacs SE:
https://emacs.stackexchange.com/questions/38276 which asks this exact
question. I'm mentioning it just in case someone has this question
again.
P.
I would probably do it like this:
(org-element-map (org-element-parse-buffer) 'link
(lambda (lnk)
(let ((lnkplist '()))
(setq lnkplist (plist-put lnkplist :link (org-element-property
:raw-link lnk)))
(when (org-element-property :contents-begin lnk)
(setq lnkplist (plist-put lnkpl
I've written the following function for retrieving the links from a
given Org Mode buffer.
#+BEGIN_SRC elisp
(defun my/org-collect-links-in-buffer (buffer)
"Collect all the links in the current buffer. If the link has a
description, then it is also collected.
Returns a list of PLISTS of the f