From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Re: Multicite syntax Date: Tue, 17 Mar 2015 09:44:37 -0700 Message-ID: <87oanr1slm.fsf@berkeley.edu> References: <54FBEC42.2060507@gmail.com> <8761ab5u8j.fsf@nicolasgoaziou.fr> <8761a37duj.fsf@berkeley.edu> <87ioe32pcq.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXucZ-0000nU-9J for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 12:45:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXucT-0007uG-FG for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 12:45:35 -0400 Received: from plane.gmane.org ([80.91.229.3]:40158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXucT-0007u6-8S for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 12:45:29 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YXucO-0004HX-5b for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 17:45:24 +0100 Received: from c-67-169-117-151.hsd1.ca.comcast.net ([67.169.117.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2015 17:45:24 +0100 Received: from richard.lawrence by c-67-169-117-151.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2015 17:45:24 +0100 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: emacs-orgmode@gnu.org Cc: Nicolas Goaziou Hi Nicolas, Nicolas Goaziou 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