emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] ob-R ignores ess-eval-visibly?


From: Aaron Ecay
Subject: Re: [O] ob-R ignores ess-eval-visibly?
Date: Wed, 09 Sep 2015 20:30:18 +0100
User-agent: Notmuch/0.20.2+65~gbd5504e (http://notmuchmail.org) Emacs/25.0.50.2 (x86_64-unknown-linux-gnu)

Hi Tamas,

2015ko irailak 4an, Tamas Papp-ek idatzi zuen:
> 
> Hi,
> 
> I prefer ESS not to wait for results of evaluating R code, especially if
> it takes a longer time (eg estimating a model in RStan, 1-2 minutes), so
> I have
> 
> (setq ess-eval-visibly 'nowait)
> 
> But I find that ob-R ignores this, eg evaluating
> 
> #+BEGIN_SRC R :results none
>   Sys.sleep(10)
> #+END_SRC
> 
> I looked at the source and I think I understand why this is: the results
> need to be inserted into the buffer. However, could there be an
> exception for :results none, when they are not needed? Then I could put
> code which takes a long time into these blocks, and they would not block
> my Emacs.

I think this suggestion will not deal well with the following cases:

1. :cache – the code block hash in the #+results line needs to be
   updated.  For correctness, this should only be done after the block
   has finished execution
2. :session – the long-running code block will block the session
   subprocess, so that any further code blocks executed in the document
   will block

The remaining cases (:results none :cache no :session no) pick out a very
specific set of circumstances, and I’m not sure it would be worth the
additional complexity (conceptually and implementationally) to support
it.  For example, it would probably entail changing all backends, in
addition to core babel code, since the current backend API contains just
one function to evaluate-wait-and-return-result.

OTOH it might be possible to add an async evaluation facility to babel,
with an explicit enabling condition (:async yes) and corresponding new
function(s) in the backend API, which could be implemented gradually and
only where they made sense.  But that’s a big project.

-- 
Aaron Ecay



reply via email to

[Prev in Thread] Current Thread [Next in Thread]