From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: [BABEL] BUG Re: Omitting try/catch blocks from tangled R code? Date: Fri, 07 Feb 2014 09:26:22 +0100 Message-ID: <52F498AE.6090802@krugs.de> References: Reply-To: Rainer@krugs.de Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QlxHkXXEdOOIj4s9Je5NGuoXaKstKd9le" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBglf-0001vO-I2 for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 03:26:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBgla-0000sJ-HO for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 03:26:35 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:50750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBgla-0000rW-C7 for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 03:26:30 -0500 Received: by mail-wi0-f179.google.com with SMTP id hn9so584047wib.0 for ; Fri, 07 Feb 2014 00:26:29 -0800 (PST) In-Reply-To: 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: John Hendy , emacs-orgmode This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QlxHkXXEdOOIj4s9Je5NGuoXaKstKd9le Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/07/14, 07:18 , John Hendy wrote: > Greetings, >=20 >=20 > 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. >=20 > 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: >=20 > pdf(file=3D"file.pdf"); tryCatch({ >=20 > code block contents here >=20 > },error=3Dfunction(e){plot(x=3D-1:1, y=3D-1:1, type=3D'n', xlab=3D'', y= lab=3D'', > axes=3DFALSE); text(x=3D0, y=3D0, labels=3De$message, col=3D'red'); > paste('ERROR', e$message, sep=3D' : ')}); dev.off() >=20 > 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). >=20 > I'm guessing this is here to create a blank plot with the error as the > output when something goes awry? Yes. >=20 > 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...). Cheers, Rainer >=20 >=20 > Thanks, > John >=20 --=20 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: Rainer@krugs.de Skype: RMkrug --QlxHkXXEdOOIj4s9Je5NGuoXaKstKd9le Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJS9JizAAoJENvXNx4PUvmCioIH/1MggSpdAa4CImyFqsPo6YF+ Elu9NRsuY86HlCkv3yByzBn31NmIHV5hGObF/CMbKS3CSkh31hU+eWFTFAQhSS/c bguZhpuLG2PJZtae/bHxQ0rgb9pngB9cfGAmHomofg95QYWuznF9z/QBoHzd0IW9 I3M+aMxtErbCL29YIEDw/cnLbDqFgTnsg6HLkmUwbI8vWr+Km8QmUptBXaLueZ/N xuoTT8GU6IfnZ/ddz4t8Y1rNwkvRT3i8Cw7pZTgLp8c8z9lqBxYVMU69p0azahro T2lmVFR8QcyKmNudQL9UwLhBAdicv+1LnQefGGxE6Khv2jI9qwL+zMdllX4eFnE= =0jGs -----END PGP SIGNATURE----- --QlxHkXXEdOOIj4s9Je5NGuoXaKstKd9le--