From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Two potentially useful functions for org-element Date: Fri, 08 Aug 2014 10:27:01 +0200 Message-ID: <87mwbfv12i.fsf@gmail.com> References: <87wqalql21.fsf@gmail.com> <87egwro1ba.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFfWG-0005vV-B8 for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 04:27:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFfW9-0002dk-1q for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 04:27:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:54858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFfW8-0002cz-Qt for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 04:27:16 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XFfW7-0002gg-6f for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 10:27:15 +0200 Received: from e178190240.adsl.alicedsl.de ([85.178.190.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Aug 2014 10:27:15 +0200 Received: from tjolitz by e178190240.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Aug 2014 10:27:15 +0200 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: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Thorsten Jolitz writes: > >> now that I understand the 'org-element API' a bit better, I think that >> the following two functions can be very useful for creating and >> modifying Org elements without the usual point movements, regexp >> searches and string operations in a buffer: > > Element isn't really meant to provide tools to modify the buffer. It is > only a parser, i.e. buffer to parse tree transformation. > > The reciprocal, i.e., modifying a parse tree in order to alter the > buffer may belong to another library. IIRC, this is the goal of > "org-sync" (from GSOC 2012). You may want to look into it. Sorry, did not read this before writing my other recent post ... I will have a look at org-sync, but even if Element isn't really meant to provide tools to modify the buffer, it seems to be tremendously useful in doing so? The most limiting aspect I found is the missing access to an elements content (see my parallel post wrt to this topic). Otherwise 'rewiring' an elements internals looks like a huge productivity booster compared to the usual buffer operations on the textual representation. As long as the interpreter works as expected, and it does! -- cheers, Thorsten