emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Vikas Rawal <vikaslists@agrarianresearch.org>,
	Daniele Pizzolli <dan@toel.it>,
	org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Evaluating R source code line by line
Date: Sat, 13 Dec 2014 14:38:22 -0500	[thread overview]
Message-ID: <87vblf2vdd.fsf@gmail.com> (raw)
In-Reply-To: <437630D3-66D0-4D3F-BCD2-5F1731776CAC@agrarianresearch.org>

Hi Vikas,

2014ko abenudak 13an, Vikas Rawal-ek idatzi zuen:
> 
> On 13-Dec-2014, at 3:42 pm, Daniele Pizzolli <dan@toel.it> wrote:
>> Look at:
>> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
>> 
>> Use ESS to step through evaluation line-by-line
>> 
>> Use C-c ' to visit the edit buffer for your code block
>> Use ess-eval-line-and-step to evaluate each line in turn
>> 
>> ess-eval-line-and-step is usually bound to C-c C-n
> 
> I know this and use it. But since my code evaluation is quite resource
> intensive, when I later evaluate the code using C-c C-c to insert
> results in my org buffer, it would be useful to see how far it is
> progressing.

See the thread beginning at
<http://mid.gmane.org/8638cfr7ua.fsf@somewhere.org>.  I’m not sure this
feature is actually workable, however, even aside from the performance
issues alluded to in that thread.  There are various methods that babel
uses to evaluate R code, not all of which are amenable to line-by-line
echoing.  In the future, I think babel should move towards an approach
which separates the code actually evaluated in R from the contents of
the code block further.  (See my patch at
<http://mid.gmane.org/87wqa9owhv.fsf@gmail.com> for an example of what I
mean).  This will make line-by-line echoing confusing (since what would
be echoed has little relation to the actual code).

If enough people really want it, the let-binding around ess-eval-visibly-p
in ob-R.el can be removed, but IMO there should be an understanding that:
1) This won’t make all evaluation echo line-by-line.
2) Preserving line-by-line echoing mustn’t be allowed to block the
   evolution of other features that are incompatible with it.

For your use case, I would suggest adding print() calls in strategic
places in your long-running code, which will appear in the R buffer to
let you know how it’s progressing.

-- 
Aaron Ecay

  reply	other threads:[~2014-12-13 19:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-13  2:26 Evaluating R source code line by line Vikas Rawal
2014-12-13 10:12 ` Daniele Pizzolli
2014-12-13 13:18   ` Vikas Rawal
2014-12-13 19:38     ` Aaron Ecay [this message]
2014-12-15 22:58       ` Vikas Rawal
2014-12-16 16:32         ` Andreas Leha
2014-12-16 18:43           ` Andreas Leha

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=87vblf2vdd.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=dan@toel.it \
    --cc=emacs-orgmode@gnu.org \
    --cc=vikaslists@agrarianresearch.org \
    /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).