emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Vitalie Spinu <spinuvit@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-export: how to copy the parsed tree?
Date: Sun, 02 Mar 2014 10:13:43 +0100	[thread overview]
Message-ID: <87iorxnet4.fsf@gmail.com> (raw)
In-Reply-To: <877g8deht5.fsf@gmail.com> (Vitalie Spinu's message of "Sat, 01 Mar 2014 13:21:26 -0800")

Hello,

Vitalie Spinu <spinuvit@gmail.com> 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

      reply	other threads:[~2014-03-02  9:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01  1:20 org-export: how to copy the parsed tree? Vitalie Spinu
2014-03-01  8:45 ` Thorsten Jolitz
2014-03-01 10:21   ` Thorsten Jolitz
2014-03-01 11:36 ` Nicolas Goaziou
2014-03-01 18:24   ` Vitalie Spinu
2014-03-01 21:02     ` Nicolas Goaziou
2014-03-01 21:21       ` Vitalie Spinu
2014-03-02  9:13         ` Nicolas Goaziou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iorxnet4.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=spinuvit@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).