From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Programmatically constructing org documents Date: Sun, 26 Jun 2016 11:12:11 -0400 Message-ID: References: <87fus2d659.fsf@systemreboot.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHBjP-0002FF-Cg for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 11:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHBjK-0001Eo-AY for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 11:12:19 -0400 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:36018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHBjK-0001Ek-6R for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 11:12:14 -0400 Received: by mail-qk0-x229.google.com with SMTP id p10so186540549qke.3 for ; Sun, 26 Jun 2016 08:12:14 -0700 (PDT) In-reply-to: <87fus2d659.fsf@systemreboot.net> 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" To: Arun Isaac Cc: "emacs-orgmode@gnu.org" I don't know if there is a "correct" way. It might depend on how sophisticated the document is. I usually use strings and format. Sometimes that is a pain though, if there is a lot of conditional formatting. So the question is which is easier for your situation, and I would say easier is "correct" ;) Arun Isaac writes: > What is the "correct" way to programmatically construct org documents? > > Should I construct a parse tree, and then use > `org-element-interpret-data' to convert it org syntax? > > Or, should I use string and buffer functions (such as `format' and > `insert') to construct org syntax directly? > > Thank you, > Arun Isaac. -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu