From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [BABEL] BUG Re: Omitting try/catch blocks from tangled R code? Date: Mon, 17 Mar 2014 09:00:09 -0600 Message-ID: <877g7syio6.fsf@gmail.com> References: <52F498AE.6090802@krugs.de> <87siruamo3.fsf@gmail.com> <52F5326C.7010505@krugs.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPZ3U-0000ZL-GZ for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 11:02:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPZ3P-0002CU-Sj for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 11:02:20 -0400 Received: from mail-pd0-x231.google.com ([2607:f8b0:400e:c02::231]:59789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPZ3P-0002CK-MJ for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 11:02:15 -0400 Received: by mail-pd0-f177.google.com with SMTP id y10so5602445pdj.8 for ; Mon, 17 Mar 2014 08:02:14 -0700 (PDT) In-Reply-To: (John Hendy's message of "Tue, 11 Mar 2014 20:13:34 -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: John Hendy Cc: Rainer@krugs.de, emacs-orgmode John Hendy writes: > On Fri, Feb 7, 2014 at 1:22 PM, Rainer M Krug wrote: >> >> >> >> On 02/07/14, 17:47 , Eric Schulte wrote: >> > Rainer M Krug writes: >> > >> >> 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 believe this was introduced by your commit eaa3a761d. Reversion of >> > which with the following should provide a temporary workaround. >> I take this back, the behavior is unrelated to Rainer's commit adding try/catch blocks to R graphics creation logic. In fact I don't believe this is a bug, rather the default behavior is to expand code block bodies on tangling. This behavior may be changed by using the :no-expand header argument which will inhibit code block body expansion during tangling. Best, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D