From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] feature request - tangle-and-evaluate-tangled-file Date: Thu, 08 Jul 2010 12:03:29 -0700 Message-ID: <871vbdu77i.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=38124 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWwNz-00071R-KQ for emacs-orgmode@gnu.org; Thu, 08 Jul 2010 15:03:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWwNg-0003Un-Sz for emacs-orgmode@gnu.org; Thu, 08 Jul 2010 15:03:33 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:38504) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWwNg-0003S4-Pw for emacs-orgmode@gnu.org; Thu, 08 Jul 2010 15:03:32 -0400 Received: by mail-iw0-f169.google.com with SMTP id 2so1495591iwn.0 for ; Thu, 08 Jul 2010 12:03:32 -0700 (PDT) In-Reply-To: (Rainer M. Krug's message of "Tue, 6 Jul 2010 09:55:56 +0200") 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: Rainer M Krug Cc: emacs-orgmode Hi Rainer, I just pushed up a new hook `org-babel-post-tangle-hook' which can be used to run activities in tangled code files immediately after tangling. I believe the following can be used implement the feature you described with this hook. (add-hook 'org-babel-post-tangle-hook (lambda () (ess-load-file (buffer-file-name)))) Best -- Eric Rainer M Krug writes: > Hi > > I am using org-babel for literate programming in R and I am using the > following approach to test the code: > > 1) tangle > 2) refresh buffer containing the tangled code (I use auto-revert-mode or > global-auto-revert-mode for that) > 3) load the tangled file into an existing R session via ESS R for evaluation > > This involves switching between buffers in always the same sequence. > Therefore my suggestion: > > would it be possible to have a tangle-and-evaluate-tangled-file funcction, > which is doing this automatically? > > C-c - 0 and org-babel-execute-buffer do not work in this case, as functions > are split over several code blocks in R. > > Cheers, > > Rainer