From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-export: how to copy the parsed tree? Date: Sun, 02 Mar 2014 10:13:43 +0100 Message-ID: <87iorxnet4.fsf@gmail.com> References: <87wqgeemto.fsf@gmail.com> <87vbvyp2v5.fsf@gmail.com> <87ob1pepzh.fsf@gmail.com> <878ustpr7k.fsf@gmail.com> <877g8deht5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WK2Sz-0007M6-SF for emacs-orgmode@gnu.org; Sun, 02 Mar 2014 04:13:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WK2Sr-000413-Ec for emacs-orgmode@gnu.org; Sun, 02 Mar 2014 04:13:49 -0500 Received: from mail-we0-x234.google.com ([2a00:1450:400c:c03::234]:34318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WK2Sr-00040y-8K for emacs-orgmode@gnu.org; Sun, 02 Mar 2014 04:13:41 -0500 Received: by mail-we0-f180.google.com with SMTP id p61so789504wes.25 for ; Sun, 02 Mar 2014 01:13:40 -0800 (PST) In-Reply-To: <877g8deht5.fsf@gmail.com> (Vitalie Spinu's message of "Sat, 01 Mar 2014 13:21:26 -0800") 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: Vitalie Spinu Cc: emacs-orgmode@gnu.org Hello, Vitalie Spinu writes: > Is there an idiomatic way to do this? Like constructors of org elements? > Or, one just starts with an empty '(headline) list You can even start with '(org-data nil). > and populate it with org-element-set-contents and > org-element-put-property? I would use `org-element-adopt-elements' instead `org-element-set-contents', which is too low level. The former will take care of setting the appropriate :parent property. You can probably extract headlines with `org-element-extract-element', duplicate them as many times as you want, and insert them back with `org-element-adopt-elements'. This is just a rough idea; I don't have any algorithm to offer. Regards, -- Nicolas Goaziou