[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [BABEL] BUG Re: Omitting try/catch blocks from tangled R code?

From: Rainer M Krug
Subject: [O] [BABEL] BUG Re: Omitting try/catch blocks from tangled R code?
Date: Fri, 07 Feb 2014 09:26:22 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 02/07/14, 07:18 , John Hendy wrote:
> Greetings,
> I don't usually tangle, but am creating a code file to go along with a
> presentation I'm giving this weekend so that attendees can try things
> out afterward by cloning my github repo where all the data and
> necessary files are stored.
> In my presentation (Beamer), I create plots via the R pdf() device,
> and noticed that all of the tangled code where plots are generated
> contains the following:
> pdf(file="file.pdf"); tryCatch({
>   code block contents here
> },error=function(e){plot(x=-1:1, y=-1:1, type='n', xlab='', ylab='',
> axes=FALSE); text(x=0, y=0, labels=e$message, col='red');
> paste('ERROR', e$message, sep=' : ')}); dev.off()
> Is there a way to omit this?

This is a bug which must have been introduced some time ago - in the
stock version of emacs (Org-mode version 7.9.3f
(release_7.9.3f-17-g7524ef @
/usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/org/)) it does not
tangle the enclosing commands to create graphics, but in 8.2 it does (I
don't have an older version at hand to go further back).

> I'm guessing this is here to create a blank plot with the error as the
> output when something goes awry?


> I checked around variable completions of org-babel-tangle-* and
> searched google for terms like "org babel tangle try catch" but am not
> finding anything that looks like what I need.

There is nothing, as it should not be tangled. The enclosing commands
concern the export, but not tangling,

I agree that the :result graphics header argument caused commands should
not be in the tangled file.

Another question is about the :epilogue and :prologue which I think
should be present (haven't checked if they are...).



> Thanks,
> John

Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      address@hidden

Skype:      RMkrug

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]