From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [PATCH] -for review- Tangling with variable transfer of variables Date: Tue, 24 Jun 2014 14:28:32 +0200 Message-ID: References: <87zjh8bo8s.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]:50839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzPqH-0007Bu-GU for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 08:28:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzPqB-0003uh-4K for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 08:28:53 -0400 Received: from mail-we0-f180.google.com ([74.125.82.180]:56154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzPqA-0003ty-Ss for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 08:28:47 -0400 Received: by mail-we0-f180.google.com with SMTP id x48so255329wes.39 for ; Tue, 24 Jun 2014 05:28:42 -0700 (PDT) In-Reply-To: (Charles C. Berry's message of "Mon, 23 Jun 2014 11:25:11 -0700") 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: "Charles C. Berry" Cc: emacs-orgmode@gnu.org, Eric Schulte --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable "Charles C. Berry" writes: > On Mon, 23 Jun 2014, Rainer M Krug wrote: > >> "Charles C. Berry" writes: >> >> V> On Fri, 20 Jun 2014, Rainer M Krug wrote: >>> >>>> Attached please find =3Dthe reworked patch. >>>> >>>> 1) uses local() and closes connection >>>> 2) does not leave a variable cal;led file behind >>>> >>> > > [deleted] > >> >> OK - attached please find two patches: >> >> 0001-lisp-ob-R.el-Fix-tangling-with-tables.patch >> 0002-Make-transfer-of-values-from-R-type-aware.patch >> >> The first one fixes tangling with tables including discussed >> suggestions, the second one moves the definition of the R code into >> defconst and introduces type awareness for the transfer of *values*, but >> not tables. I reworked your suggestion and now integer are transferred >> to R as integers (L) and float as double. >> This already worked for tables. >> >> Could you please check the second patch? In my checks everything worked >> as expected. > > I think these are good to go. Great - Eric - could you apply them if you are happy as well? > > I checked several cases and all seemed to work as expected. Good to know. > > Some comments on this and your recent posts in this thread: > > I see you took the suggestion to use (prin1-to-string value) on the=20 > 'left-over' objects. With that stuff like :var x=3D[1 2 3] will work. :-) > > The only failure I could trigger was with this block: > > #+BEGIN_SRC R :session :var x=3D(org-export-get-backend 'latex) > x > #+END_SRC > > which triggered 'Eval buffer', added a bunch of ^G's to my session log,=20 > and hung until I ran C-g (keyboard-quit). > > When run with :session none, it works. I suspected the long string trippe= d=20 > over a limitation or bug in iESS-mode or comint-mode, but this runs: Am I wrong, or is this a rather unusual usage scenario?=20 When I copy the command executed into an R session outside emacs/ESS, it gives me a new line with a +, so the command is not complete and requires a " to complete. But then the vartiable only contains a part of the string. So I guess there is a problem with escaping the string. When I paste it into an R session in emacs, I get these ^G. Given that your example below (with a more usual variable?) works, and the error above is also present when using the actual implementation of the variable transfer, I would leave it as an unsolved mystery and investigate afterwards. Cheers, Rainer > > #+BEGIN_SRC R :session :var x=3D(append (make-vector 10000 '(1 2)) '((1 2= 3)))=20 > :results output > summary(x) > #+END_SRC > > so I am not sure what gives. > > Chuck > =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/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJTqW70AAoJENvXNx4PUvmCNi8IANbLN249O7nA4RY7w8PO5KYN wlPPlqt6XXCG/ftjQfgQBBOjAVnGhBYyQBB0xuDcfwgxP6T491c4XWb4d6a8DHZv uOwU78hzUm5Qd6QgiWtfsfU02kbukhXysmHc+9v1ka5gkngUS/04Foa2q3kuA3sl AAZrMFb8yBEmVomPd5eOWMEYiRO9cQlm/GRMSxWBIZ3/3KjkLYLFSN5iEJ+1JkFk WnmEPzx/0fHHYPwRr0TiosA30Z3weuhF+7xGVk/9D6YhgvlLm3L4SwYrV4X17mn3 c4gLDx07FJoT8JTzLa0pGPdAogSO3MX+ZUuNeIFYeZ3ort5UF9QXNgWJaqJGWO8= =uh4E -----END PGP SIGNATURE----- --=-=-=--