From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: tangling order Date: Tue, 16 Feb 2016 09:34:22 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVjWP-00077w-ME for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 12:34:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVjWM-00064A-DK for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 12:34:45 -0500 Received: from iport-acv6-out.ucsd.edu ([132.239.0.13]:13448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVjWM-00063Z-4B for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 12:34:42 -0500 In-Reply-To: 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: Alan Schmitt Cc: emacs-orgmode , John Kitchin On Tue, 16 Feb 2016, Alan Schmitt wrote: > On 2016-02-16 12:42, John Kitchin writes: > >> I think you are seeing that the blocks are tangled in reverse. If I add a third >> arbitrary lang it comes in reverse. > > Interesting! Thanks a lot for trying it. > > I see that I made the typical scientific method mistake of testing for > my hypothesis, instead of testing against. > >> If they are all the same language, they are in the right order. It looks like >> org collects by language, so your strategy won't work with org-babel tangle I >> guess. > > I've found a workaround, as it is only for a few blocks I manually > change their headers, so it is fine at the moment. Another workaround would be to add after advice to `org-babel-get-src-block-info' to map your faux languages to a common variant. > I still think it > would be great to have better control on the order in which blocks are > tangled. If you want to do this inside org/emacs (and not stitch a bunch of tangled files together with other tools), try this in your *.org file and execute it. The result is what you might work with (i.e. customize or advice the function below). #+BEGIN_SRC emacs-lisp :results pp :tangle foo.ml (org-babel-tangle-collect-blocks) #+END_SRC HTH, Chuck