emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Multicite syntax


From: Nicolas Goaziou
Subject: Re: [O] Multicite syntax
Date: Sat, 14 Mar 2015 23:20:21 +0100

Richard Lawrence <address@hidden> 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

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