From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: [babel] suggestion: wrap creation of graphics into try() block Date: Tue, 21 Jan 2014 11:03:20 +0100 Message-ID: <87zjmp1wk7.fsf@med.uni-goettingen.de> References: <52DD2660.3090403@krugs.de> <878uua3g91.fsf@med.uni-goettingen.de> <52DD3D34.7090101@krugs.de> <87txcyy8dm.fsf@gmail.com> <52DD56A5.4080901@krugs.de> <87ob36wlbp.fsf@gmail.com> <52DE4372.5090800@krugs.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5YBH-0005ur-So for emacs-orgmode@gnu.org; Tue, 21 Jan 2014 05:03:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5YBB-0007A5-Nk for emacs-orgmode@gnu.org; Tue, 21 Jan 2014 05:03:39 -0500 Received: from plane.gmane.org ([80.91.229.3]:45218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5YBB-00079m-Hl for emacs-orgmode@gnu.org; Tue, 21 Jan 2014 05:03:33 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W5YB9-000108-W2 for emacs-orgmode@gnu.org; Tue, 21 Jan 2014 11:03:31 +0100 Received: from genepi110.genepi.med.uni-goettingen.de ([134.76.140.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jan 2014 11:03:31 +0100 Received: from andreas.leha by genepi110.genepi.med.uni-goettingen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jan 2014 11:03:31 +0100 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: emacs-orgmode@gnu.org Hi Rainer, really cool. I am very short on time right now, so I can't promise I'll get around to test it soon. Just one comment: Rainer M Krug writes: > On 01/20/14, 19:38 , Eric Schulte wrote: >>> >>> I will check it a little bit longer and see that I can display >>> the error message in the dummy graphic. Should have it by >>> tomorrow. >>> >> >> Sounds good. Alternately, maybe you could get the R process to >> fail and print an error to STDERR so that the export will stop >> immediately and inform the user of the error. > > I think it is better to catch the error and return with the > computations in the next block, because > > 1) a code block which produces a graph is most often an end point, > i.e. further blocks should (as I see it) not rely on the output of > this block If all (your) documents follow that rule, that blocks producing graphical output are not needed later on, than it might be cool to have an [draft]-like option in Org that by default replaces all images (not just failing ones) with a cheap-to-export graphic. For some of my documents that is a real time saver. I can mimic that now by passing a variable 'draft' to the code blocks and deal with it internally. But that means a lot of manual coding. > > 2) if the export continues, one can fix more then one error at a time, > so being more efficient. > > 3) If the export continues, it makes it possible to use this to create > placeholder graphs: > > #+begin_src R :file TheFantasticGraph.pdf :results graphics > stop("This is a placeholder for a new fantastic graph" > #+end_src > > Where TheFantasticGraph will display the message "This is a > placeholder for a new fantastic graph". > > I have now added the error to the normal R output in addition to a > graph, but the export is not canceled. > > >> >>> >>> I'll send you the patch then. >>> >> >> Sounds great, thanks. > > OK - here it is attached (my first patch to org :-) ) - let me know if > it is OK. > Really nice addition! Thanks already (without testing the patch)! [ ... ] Regards, Andreas