From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Reyero Subject: Re: Buffer-wide definitions in org-babel Date: Thu, 8 Oct 2009 13:16:11 +0200 Message-ID: <55bd243d0910080416u27bb9debjd9a5d9d86bc06231@mail.gmail.com> References: <55bd243d0910070720i3085af58xc30cf14011d6375a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mvqyo-0000ed-J7 for emacs-orgmode@gnu.org; Thu, 08 Oct 2009 07:16:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mvqyi-0000Z9-NH for emacs-orgmode@gnu.org; Thu, 08 Oct 2009 07:16:17 -0400 Received: from [199.232.76.173] (port=59675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mvqyi-0000Z2-G9 for emacs-orgmode@gnu.org; Thu, 08 Oct 2009 07:16:12 -0400 Received: from mail-bw0-f220.google.com ([209.85.218.220]:63231) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mvqyi-0007ZV-6y for emacs-orgmode@gnu.org; Thu, 08 Oct 2009 07:16:12 -0400 Received: by bwz20 with SMTP id 20so5605880bwz.42 for ; Thu, 08 Oct 2009 04:16:11 -0700 (PDT) In-Reply-To: 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: emacs-orgmode@gnu.org Hi, On Wed, Oct 7, 2009 at 9:17 PM, Eric Schulte wrote: > As you described below the :session environment can be used to deal with > the need for required "stage setting" source-code blocks, however there > is currently no way when directly executing a block to specify that some > other block in the same session must be evaluated first to setup the > environment. > > Perhaps a new header argument named :requires would be useful here. > This would allow any block to "require" that some other named > source-code block be prepended to it's self before evaluation. Sounds like a good solution. Another possibility would be to add an option that makes chunks dependent on other chunks that appear earlier in the buffer. It is less general, but possibly simpler to implement (you don't have to worry about circular dependencies) and less verbose. If you could assume a functional style without side effects you could even track which chunks are up-to-date, and only re-compute from the first one not up-to-date in the buffer onwards to the chunk you are being asked to process. This could be yet another option. Best, jm -- http://juanreyero.com/blog