Richard Lawrence <richard.lawre...@berkeley.edu> writes:

> With this change, what's the proper way to get the citation-references
> inside a citation?  Before this change, one could simply do:
>
> (org-element-property :references citation) 
>
> to get the references in a citation; what's the equivalent incantation
> now?

[...]

> But, AFAICT, citation objects do not actually have citation-reference
> objects within them, at least when returned by org-element-context.

`org-element-context' never returns contents of objects or elements.

> I'm sure there is something simple I am misunderstanding here about how
> nested objects work...can you enlighten me?

You could do the following

  (let ((citation (org-element-lineage (org-element-context) '(citation) t))
        references)
    (save-excursion
      (goto-char (org-element-property :contents-begin citation))
      (let ((end (org-element-property :contents-end citation)))
        (while (< (point) end)
          (let ((reference (org-element-lineage
                            (org-element-context) '(citation-reference) t))))
          (push reference references)
          (goto-char (org-element-property :end reference)))))
    (nreverse references))

Regards,

Reply via email to