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, 07 Apr 2014 09:59:29 +0200 Message-ID: References: <87siruamo3.fsf@gmail.com> <52F5326C.7010505@krugs.de> <877g7syio6.fsf@gmail.com> <87txawwwh6.fsf@gmail.com> <87r45xeabf.fsf@gmail.com> <87fvm8gxok.fsf@gmail.com> <87siq7g2j5.fsf@gmail.com> <87d2h71qqc.fsf@bagel.gateway.pace.com> <87fvlzg45i.fsf@gmail.com> <87bnwio5x4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=sha1; protocol="application/pkcs7-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX4Sy-0002bM-GI for emacs-orgmode@gnu.org; Mon, 07 Apr 2014 03:59:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WX4Ss-0001nV-85 for emacs-orgmode@gnu.org; Mon, 07 Apr 2014 03:59:40 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:57235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX4Sr-0001mx-VE for emacs-orgmode@gnu.org; Mon, 07 Apr 2014 03:59:34 -0400 Received: by mail-wi0-f172.google.com with SMTP id hi2so4542827wib.5 for ; Mon, 07 Apr 2014 00:59:32 -0700 (PDT) In-Reply-To: <87bnwio5x4.fsf@gmail.com> (Eric Schulte's message of "Wed, 02 Apr 2014 17:09:37 -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; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eric Schulte writes: > Rainer M Krug writes: > >> Eric Schulte writes: >> >>>> >>>> Apologies - I am still struggling with encryption...... >>>> >>>> So here is my example: >>>> >>>> --8<---------------cut here---------------start------------->8--- >>>> #+TITLE: single_to_multi >>>> #+DATE: <2013-10-15 Tue> >>>> #+AUTHOR: Rainer M. Krug >>>> #+EMAIL: Rainer@krugs.de >>>> >>>> =E2=89=88* Load R packages and data >>>> #+BEGIN_SRC R >>>> cat("Loading Data\n") >>>> #+END_SRC >>>> --8<---------------cut here---------------end--------------->8--- >>>> >>>> I am using only org loaded and R enabled. >>>> >>>> C-c C-c on the block produces the error >>>> >>>> emacs version:=20 >>>> GNU Emacs 24.3.1 (x86_64-apple-darwin13.0.0, Carbon Version 1.6.0 >>>> AppKit 1265) of 2014-02-13 on Rainers-MacBook-Pro-2.local >>>> >>>> org version: >>>> Org-mode version 8.2.5h (release_8.2.5h-837-gb296cc @ >>>> /Users/rainerkrug/.emacs.d/org-mode/lisp/) >>>> >>> >>> Thanks, a fixed version of the patch is attached. If this works please >>> let me know and I'll apply. >> >> Still the same error: >> > > Your previous example works as expected for me with the latest patch. > > * Load R packages and data > > #+BEGIN_SRC R :results output > cat("Loading Data\n") > #+END_SRC > > #+RESULTS: > : Loading Data > > Please double check that you applied the patch and reloaded Org-mode, > and if the bug persists provide another minimal example. Sorry - no idea what went wrong, but I assumed I applied the old patch. I applied the patch and it is working. Cheers, Rainer > > Thanks, > >> >> ,---- >> | Debugger entered--Lisp error: (wrong-type-argument sequencep 99) >> | Mapconcat(identity "cat(\"YEAR\")" "\n") >> | Org-babel-execute:R("cat(\"YEAR\")" ((:comments . "") (:shebang >> | . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle >> | . "no") (:exports . "code") (:results . "replace output") (:session >> | . "none") (:hlines . "no") (:result-type . output) (:result-params >> | "output" "replace") (:rowname-names) (:colname-names))) >> | org-babel-execute-src-block(nil) >> | org-babel-execute-src-block-maybe() >> | org-babel-execute-maybe() >> | org-babel-execute-safely-maybe() >> | run-hook-with-args-until-success(org-babel-execute-safely-maybe) >> | org-ctrl-c-ctrl-c(nil) >> | call-interactively(org-ctrl-c-ctrl-c nil nil) >> `---- >> >> Cheers, >> >> Rainer >> >> >>> >>> Best, >>> >>> >>> From d67248db79faf19e1bdcac0230c37670b6115bdd Mon Sep 17 00:00:00 2001 >>> From: Eric Schulte >>> Date: Sun, 23 Mar 2014 20:01:37 -0600 >>> Subject: [PATCH] only wrap R code graphics-file on execution >>> >>> Move this out of the expand-body function so that it is *never* >>> applied to tangled code. >>> --- >>> lisp/ob-R.el | 40 +++++++++++++++++++++------------------- >>> 1 file changed, 21 insertions(+), 19 deletions(-) >>> >>> diff --git a/lisp/ob-R.el b/lisp/ob-R.el >>> index 62aa7f2..780d99f 100644 >>> --- a/lisp/ob-R.el >>> +++ b/lisp/ob-R.el >>> @@ -97,24 +97,15 @@ this variable.") >>> "Expand BODY according to PARAMS, return the expanded body." >>> (let ((graphics-file >>> (or graphics-file (org-babel-R-graphical-output-file params)))) >>> - (mapconcat >>> - #'identity >>> - (let ((inside >>> - (append >>> - (when (cdr (assoc :prologue params)) >>> - (list (cdr (assoc :prologue params)))) >>> - (org-babel-variable-assignments:R params) >>> - (list body) >>> - (when (cdr (assoc :epilogue params)) >>> - (list (cdr (assoc :epilogue params))))))) >>> - (if graphics-file >>> - (append >>> - (list (org-babel-R-construct-graphics-device-call >>> - graphics-file params)) >>> - inside >>> - (list "},error=3Dfunction(e){plot(x=3D-1:1, y=3D-1:1, type= =3D'n', xlab=3D'', ylab=3D'', axes=3DFALSE); text(x=3D0, y=3D0, labels=3De$= message, col=3D'red'); paste('ERROR', e$message, sep=3D' : ')}); dev.off()"= )) >>> - inside)) >>> - "\n"))) >>> + (mapconcat #'identity >>> + (append >>> + (when (cdr (assoc :prologue params)) >>> + (list (cdr (assoc :prologue params)))) >>> + (org-babel-variable-assignments:R params) >>> + (list body) >>> + (when (cdr (assoc :epilogue params)) >>> + (list (cdr (assoc :epilogue params))))) >>> + "\n"))) >>>=20=20 >>> (defun org-babel-execute:R (body params) >>> "Execute a block of R code. >>> @@ -127,7 +118,18 @@ This function is called by `org-babel-execute-src-= block'." >>> (colnames-p (cdr (assoc :colnames params))) >>> (rownames-p (cdr (assoc :rownames params))) >>> (graphics-file (org-babel-R-graphical-output-file params)) >>> - (full-body (org-babel-expand-body:R body params graphics-file)) >>> + (full-body >>> + (let ((inside >>> + (list (org-babel-expand-body:R body params graphics-file)))) >>> + (mapconcat #'identity >>> + (if graphics-file >>> + (append >>> + (list (org-babel-R-construct-graphics-device-call >>> + graphics-file params)) >>> + inside >>> + (list "},error=3Dfunction(e){plot(x=3D-1:1, y=3D-1:1, type=3D= 'n', xlab=3D'', ylab=3D'', axes=3DFALSE); text(x=3D0, y=3D0, labels=3De$mes= sage, col=3D'red'); paste('ERROR', e$message, sep=3D' : ')}); dev.off()")) >>> + inside) >>> + "\n"))) >>> (result >>> (org-babel-R-evaluate >>> session full-body result-type result-params >>> --=20 >>> 1.9.1 =2D-=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 PGP: 0x0F52F982 --=-=-= Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIO4jCCBJ0w ggOFoAMCAQICEDQ96SusJzT/j8s0lPvMcFQwDQYJKoZIhvcNAQEFBQAwbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQL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