From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Multicite syntax Date: Tue, 17 Mar 2015 20:59:33 +0100 Message-ID: <87a8zb2y56.fsf@nicolasgoaziou.fr> References: <54FBEC42.2060507@gmail.com> <8761ab5u8j.fsf@nicolasgoaziou.fr> <8761a37duj.fsf@berkeley.edu> <87ioe32pcq.fsf@nicolasgoaziou.fr> <87oanr1slm.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXxwP-00033h-5x for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 16:18:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXxwF-0000US-7t for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 16:18:17 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:49725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXxwF-0000TT-2b for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 16:18:07 -0400 In-Reply-To: <87oanr1slm.fsf@berkeley.edu> (Richard Lawrence's message of "Tue, 17 Mar 2015 09:44:37 -0700") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Richard Lawrence Cc: emacs-orgmode@gnu.org Hello, Richard Lawrence writes: > Nicolas Goaziou writes: >> 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! For correctness, (push ...) and (goto-char ...) obviously need to be located within the (let ...). > 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? No, with a full parse tree, `org-element-contents' on a citation object returns the list of all citation-reference objects within. > 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. I don't know. In any case, they need to be treated as regular object (e.g., they are expected to have a filter associated to them). If some back-end doesn't need to export directly citation references, it just needs to skip the relative translator. Regards, -- Nicolas Goaziou