emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <Rainer@krugs.de>
To: "Charles C. Berry" <ccberry@ucsd.edu>
Cc: emacs-orgmode@gnu.org, Eric Schulte <schulte.eric@gmail.com>
Subject: Re: [PATCH] -for review- Tangling with variable transfer of variables
Date: Tue, 24 Jun 2014 14:28:32 +0200	[thread overview]
Message-ID: <m2vbrqjxu7.fsf@krugs.de> (raw)
In-Reply-To: <alpine.OSX.2.00.1406231058130.341@charles-berrys-macbook.local> (Charles C. Berry's message of "Mon, 23 Jun 2014 11:25:11 -0700")

[-- Attachment #1: Type: text/plain, Size: 3119 bytes --]

"Charles C. Berry" <ccberry@ucsd.edu> writes:

> On Mon, 23 Jun 2014, Rainer M Krug wrote:
>
>> "Charles C. Berry" <ccberry@ucsd.edu> writes:
>>
>> V> On Fri, 20 Jun 2014, Rainer M Krug wrote:
>>>
>>>> Attached please find =the 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 
> 'left-over' objects. With that stuff like :var x=[1 2 3] will work. :-)
>
> The only failure I could trigger was with this block:
>
> #+BEGIN_SRC R :session :var x=(org-export-get-backend 'latex)
> x
> #+END_SRC
>
> which triggered 'Eval buffer', added a bunch of ^G's to my session log, 
> and hung until I ran C-g (keyboard-quit).
>
> When run with :session none, it works. I suspected the long string tripped 
> 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? 

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=(append (make-vector 10000 '(1 2)) '((1 2 3))) 
> :results output
> summary(x)
> #+END_SRC
>
> so I am not sure what gives.
>
> Chuck
>

-- 
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

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

  reply	other threads:[~2014-06-24 12:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19 20:19 [PATCH] -for review- Tangling with variable transfer of variables Rainer M Krug
2014-06-19 21:09 ` Aaron Ecay
2014-06-19 23:23   ` Charles Berry
2014-06-20 13:15     ` Rainer M Krug
2014-06-20 20:34       ` Rainer M Krug
2014-06-21 19:44         ` Charles C. Berry
2014-06-22  3:39           ` Aaron Ecay
2014-06-23 10:46             ` Rainer M Krug
2014-06-23  8:57           ` Rainer M Krug
2014-06-23  9:14           ` Rainer M Krug
2014-06-23 17:56             ` Charles C. Berry
2014-06-24 12:08               ` Rainer M Krug
2014-06-23 10:45           ` Rainer M Krug
2014-06-23 18:25             ` Charles C. Berry
2014-06-24 12:28               ` Rainer M Krug [this message]
2014-06-20 13:07   ` Rainer M Krug

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2vbrqjxu7.fsf@krugs.de \
    --to=rainer@krugs.de \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).