Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > Thorsten Jolitz <tjol...@gmail.com> writes: > >> I see, thanks. I'm still getting used to the 'org-element API', but it >> seems to be much easier than I thought: just use >> org-element-at-point' and >> `org-element-interpret-data' in most cases ... > > Correct. > > For completeness, if you're working at the local level (i.e. with > `org-element-at-point'), available accessors are > > - `org-element-type' > - `org-element-property' > > When you're working at the global level (i.e. with > `org-element-parse-buffer'), you get another accessor, > `org-element-contents', and some tools to modify the parse tree > > - `org-element-put-property' > - `org-element-adopt-element' > - `org-element-insert-before' > - `org-element-extract-element' > - `org-element-set-element' > > In both cases, `org-element-interpret-data' is the only way to turn data > back into Org syntax.
That makes things much clearer, thanks. I definitely would have used `org-element-put-property' to modify a 'local' parse-tree too, but I can just as well directly use `plist-put' on the raw plist in its cdr - would that be the correct way? -- cheers, Thorsten