From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [BABEL] BUG Re: Omitting try/catch blocks from tangled R code? Date: Mon, 24 Mar 2014 11:22:05 +0100 Message-ID: References: <52F498AE.6090802@krugs.de> <87siruamo3.fsf@gmail.com> <52F5326C.7010505@krugs.de> <877g7syio6.fsf@gmail.com> <87txawwwh6.fsf@gmail.com> <87r45xeabf.fsf@gmail.com> <87fvm8gxok.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS21N-0008Mw-Ta for emacs-orgmode@gnu.org; Mon, 24 Mar 2014 06:22:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS21H-0005af-1w for emacs-orgmode@gnu.org; Mon, 24 Mar 2014 06:22:21 -0400 Received: from mail-wg0-f48.google.com ([74.125.82.48]:50049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS21G-0005ab-Ou for emacs-orgmode@gnu.org; Mon, 24 Mar 2014 06:22:14 -0400 Received: by mail-wg0-f48.google.com with SMTP id l18so3309801wgh.19 for ; Mon, 24 Mar 2014 03:22:13 -0700 (PDT) In-Reply-To: <87fvm8gxok.fsf@gmail.com> (Eric Schulte's message of "Sun, 23 Mar 2014 20:03:39 -0600") 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: Eric Schulte Cc: emacs-orgmode@gnu.org, Charles Berry --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eric Schulte writes: > Rainer M Krug writes: > >> Eric Schulte writes: >> >>> Charles Berry writes: >>> >>>> John Hendy gmail.com> writes: >>>> >>>> [deleted] >>>>> > >>>>> > I think the default behavior should be reverted, as tangling and >>>>> > exporting are two different things. When I tangle, I want to see the >>>>> > code blocks as they are in the org document (with possible variable= s and >>>>> > expansions) but not to create files where I do not put it explicitly >>>>> > into a code block. These wrappers have nothing to do with the code,= and >>>>> > are only there for the exported engine. So I would either revert to= the >>>>> > original behavior, or, introduce a new header argument, >>>>> > e.g. :include-wrappers, which would, if set to t, include the export >>>>> > wrappers in the tangled file. This might be useful for debugging >>>>> > exporting of code block results, but not for general tangling. >>>>>=20 >>>>> Thanks for chiming in. This was my gut reaction to the default >>>>> behavior. I guess we're still only a sample size of 2, but >>>>> intuitively, I would think that tangling would be a separate beast in >>>>> most cases from exporting. Just to have it on the record, if I tangle, >>>>> it's usually to take the code I've used in something like a Beamer >>>>> presentation or document and combine it into a single .R file so >>>>> someone can run it without needing Org-mode. >>>> >>>> [deleted] >>>> >>>> Sorry to be late to add my $0.02... >>>> >>>> I never want the try/catch wrappers. >>>> >>>> But noweb is indispensable. >>>> >>>> I use noweb a lot to organize and collect blocks. In some cases, I exp= ort >>>> them and in others I just tangle them. >>>> >>>> I hope that the revised code will allow me to turn off try/catch wrapp= ing >>>> and still be able to use noweb when tangling or exporting. >>>> >>> >>> In addition to noweb, there are cases where variable expansion is useful >>> in tangled code. >>> >>> The simplest option is to move things like try/catch blocks out of the >>> code block expansion function, and into the execution function. Then if >>> other language present similar constructs (which we want to add to >>> execution by default but never want to tangle), we can think about >>> abstracting this out into some new level of code block expansion. >>> >>> Thoughts? >> >> Makes perfect sense to me, and would definitely be the better place to >> add them. >> >> If one wants enclosing code in the tangling, there is always >> the :epilogue and :prologue header arguments, and the try/catch should >> be considered as internal to the execution. >> > > Great, how's this patch work? If it looks good I'll apply it. Git still puzzles me a lot... If you tell me how I can apply this patch (from emacs?) I will try it out. Thanks, Rainer > > Thanks, =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJTMAdSAAoJENvXNx4PUvmC9MIIAKeqFnT4uft8FFHP50Fe89fa LahDMsElBS7E52IW8acnor26xgmKTIIRbCp0/5yu6v7RT+/wERkgm32Pr84g+fvB ITaOCA/vj0MpggwjW/gu4l8kJIdUfxk6tgA/8R4mK7MCVYxGukaW1Zjf2XMx4+l8 fCVSaiCFhAFb+HCXZJahbWYshdO5UwmcB5CL3eX4dVHDnciBSaxOmAv64lFXo5XW xf+2vjyfdU0rhUxCCgN0f7SV1AW+bYoGt0C72wrq4DwG8gGdzal/rwmDAacZbrzV PgftChR+FJM1sSnBiP44Kxw/YnBEovn94DQhbcTySPnQbbTrC/1ORJkfdr4ssTg= =1OZ5 -----END PGP SIGNATURE----- --=-=-=--