emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-export: how to copy the parsed tree?


From: Vitalie Spinu
Subject: Re: [O] org-export: how to copy the parsed tree?
Date: Sat, 01 Mar 2014 13:21:26 -0800
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux)

 >>> Nicolas Goaziou on Sat, 01 Mar 2014 22:02:55 +0100 wrote:

[...]

 > In this case, I think I would build the tree, since data is duplicated
 > (e.g. "* H1"), not moved.

Is there an idiomatic way to do this? Like constructors of org elements?
Or, one just starts with an empty '(headline) list and populate it with
org-element-set-contents and org-element-put-property?

[...]

 >> The :parent seems to be stored in 2 places for the headline, in the
 >> headline itself and in the :title.

 > You are wrong. Headline's parent is stored only in the :parent property
 > of the headline. You get it with:

 >   (org-element-property :parent headline)

 > Within `:title', `:parent' property refers to the parent of the objects
 > contained in :title, which is the headline itself:

 >   (eq (org-element-property :parent
 >                             ;; The first object in the :title property.
 >                             (car (org-element-property :title headline)))
 >       headline)  => t

It makes sense now. Thanks.

[...]

 >> BTW, is there a way to pretty print the org tree? I think that's the
 >> main barrier for me in understanding how it all works.

 > Use `pp' and set both `print-level' and `print-circle' accordingly.

Thanks. Didn't know about this.

  Vitalie



reply via email to

[Prev in Thread] Current Thread [Next in Thread]