On Thu, Jul 8, 2010 at 9:03 PM, Eric Schulte wrote: > Hi Rainer, > Hi Eric > > 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. > Sounds perfect - thanks a lot. > > (add-hook 'org-babel-post-tangle-hook > (lambda () (ess-load-file (buffer-file-name)))) > Unfortunately, this does not work. I put the code above into my emacs.organd nothing happens - not even an error message. I tried to use the C-h v to customise the variable, but I don't manage it. In addition, The filename for es-load-file shoud not be the buffer name, but the buffer name with the extension replaced with R. I am sorry about all these questions, but emacs-lisp I have never used emacs-lisp (I should - and I will!) Cheers and thanks for your patience, Rainer > 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 > -- NEW GERMAN FAX NUMBER!!! Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Cell: +27 - (0)83 9479 042 Fax: +27 - (0)86 516 2782 Fax: +49 - (0)321 2125 2244 email: Rainer@krugs.de Skype: RMkrug Google: R.M.Krug@gmail.com