emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Multicite syntax


From: Richard Lawrence
Subject: Re: [O] Multicite syntax
Date: Tue, 17 Mar 2015 09:44:37 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Hi Nicolas,

Nicolas Goaziou <address@hidden> writes:

> `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))

Thanks!

Just to clarify: I see that this is necessary when getting a citation
object via org-element-context, but is it also necessary in an export
context, where the whole buffer or region has already been parsed?

I ask because in that kind of context, I think it is generally going to
be more useful to deal with citation objects as a whole.  I am not sure
we will want to treat citation-references as individual objects which
are themselves exported; instead, I think we will want to handle
exporting the citation-references in a citation all at once.
 
Best,
Richard




reply via email to

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