From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Babel: Call A when executing B Date: Sun, 22 Feb 2015 07:04:42 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPZxk-0004Yr-91 for emacs-orgmode@gnu.org; Sun, 22 Feb 2015 12:05:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPZxh-00080E-2j for emacs-orgmode@gnu.org; Sun, 22 Feb 2015 12:05:00 -0500 Received: from gproxy5-pub.mail.unifiedlayer.com ([67.222.38.55]:41758) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1YPZxg-00080A-SU for emacs-orgmode@gnu.org; Sun, 22 Feb 2015 12:04:57 -0500 In-Reply-To: (Ken Mankoff's message of "Sun, 22 Feb 2015 09:54:16 -0500") 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: Ken Mankoff Cc: Org-mode Aloha Ken, I'm not sure what you mean by "anything else of that type", but executing a named code block in other code blocks can be achieved with the noweb syntax. #+name: packages-that-make-iPython-great #+begin_src python import numpy as np import foo as bar ... #+end_src #+header: :noweb yes #+begin_src python <> ... #+end_src hth, Tom Ken Mankoff writes: > I'd like to have some language specific code (either a code block in the > Library of Babel, in the current file, embedded in elisp in my startup > file, wherever) run each time I execute any code block. Is there a way > to specify this via header arguments, or :prologue, or anything else of > that type? > > Reason: Org python Babel configured to work with IPython works great, > but has some limitations, such as src_python{} calls not working. I > think one way to fix this is to have babel run with python, not IPython, > but then pre-load all the packages that make IPython great. > > To be specific, how can I executed "import numpy as np" each time I "C-c > C-c" on a "+#BEGIN_SRC python" code block? > > Thanks, > > -k. > > > -- Thomas S. Dye http://www.tsdye.com