From mboxrd@z Thu Jan 1 00:00:00 1970 From: Seth Burleigh Subject: Re: Re: [babel] Painless integration of source blocks with language Date: Mon, 24 Jan 2011 08:49:24 -0600 Message-ID: References: <87lj2ukfia.fsf@gmail.com> <87k4icegwl.fsf@ucl.ac.uk> <87wrmbwdsm.fsf@gmail.com> <87aaj5tbgl.fsf@ucl.ac.uk> <87bp3ka458.fsf@gmail.com> <87hbd8kgqw.fsf@gmail.com> <80pqrv40ch.fsf@missioncriticalit.com> <87oc7dic8k.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=38534 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhNjT-0003Xs-NF for emacs-orgmode@gnu.org; Mon, 24 Jan 2011 09:49:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhNjS-0005nY-Ii for emacs-orgmode@gnu.org; Mon, 24 Jan 2011 09:49:27 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:49239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhNjS-0005n6-Eg for emacs-orgmode@gnu.org; Mon, 24 Jan 2011 09:49:26 -0500 Received: by iyj17 with SMTP id 17so4954561iyj.0 for ; Mon, 24 Jan 2011 06:49:25 -0800 (PST) In-Reply-To: <87oc7dic8k.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: =?ISO-8859-1?Q?S=E9bastien_Vauban?= , emacs-orgmode@gnu.org > You are correct, while the tangling works, the detangling still needs to > be updated to take into account the fact that there may now be nested > sections of tangled code -- which it doesn't currently. =A0Hopefully this > wont be too large of a code change... > It probably wouldnt involve much code change, since there is very few functions which operate on tangled files - detangle and jump to source block? It would be a good time to implement some functions, maybe like this, which did operate on tangled files - org-babel-detangle-src-block-info which, given a point on the line of a link, would produced something like ((end . '(0 100)) (middle . (10 90)) (children . (((end . (20 30)) ...) ... more children)) where end is the position in the buffer from the beginning of the link to the end of the matching end link, and middle is the body portion. . Then define a function which maps over all of the detangled toplevel src blocks of a file(like what is done for tangled src blocks). And then one could call org-babel-detangle-src-block which would do some recursive detangling if has children, detangle children get body string replace the children in body string (using end) with appropriate noweb synt= ax replace appropriate org block with code and then you could call org-babel-detangle which would detangle all of a file, using the map function mentioned previously to collect all source blocks. (with-error detangle all toplevel blocks of file ) where with-error will catch any errors, replace org file with original content if an error is thrown, and then reraise the error.