From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Multicite syntax Date: Sat, 14 Mar 2015 23:20:21 +0100 Message-ID: <87ioe32pcq.fsf@nicolasgoaziou.fr> References: <54FBEC42.2060507@gmail.com> <8761ab5u8j.fsf@nicolasgoaziou.fr> <8761a37duj.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXtJU-0004Zu-Ti for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 11:21:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXtJQ-0000BV-CD for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 11:21:48 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:56183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXtJQ-0000B1-6T for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 11:21:44 -0400 In-Reply-To: <8761a37duj.fsf@berkeley.edu> (Richard Lawrence's message of "Sat, 14 Mar 2015 09:17:40 -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 Richard Lawrence 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,