emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ob-R ignores ess-eval-visibly?
@ 2015-09-04  7:22 Tamas Papp
  2015-09-09 19:30 ` Aaron Ecay
  2015-09-09 21:10 ` Rainer M Krug
  0 siblings, 2 replies; 3+ messages in thread
From: Tamas Papp @ 2015-09-04  7:22 UTC (permalink / raw)
  To: emacs-orgmode

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.

Best,

Tamas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ob-R ignores ess-eval-visibly?
  2015-09-04  7:22 ob-R ignores ess-eval-visibly? Tamas Papp
@ 2015-09-09 19:30 ` Aaron Ecay
  2015-09-09 21:10 ` Rainer M Krug
  1 sibling, 0 replies; 3+ messages in thread
From: Aaron Ecay @ 2015-09-09 19:30 UTC (permalink / raw)
  To: Tamas Papp, emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ob-R ignores ess-eval-visibly?
  2015-09-04  7:22 ob-R ignores ess-eval-visibly? Tamas Papp
  2015-09-09 19:30 ` Aaron Ecay
@ 2015-09-09 21:10 ` Rainer M Krug
  1 sibling, 0 replies; 3+ messages in thread
From: Rainer M Krug @ 2015-09-09 21:10 UTC (permalink / raw)
  To: Tamas Papp; +Cc: emacs-orgmode@gnu.org



Envoyé de mon iPhone

> Le 4 sept. 2015 à 09:22, Tamas Papp <tkpapp@gmail.com> a écrit :
> 
> 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.

Easy solution: C-g will bring the focus back to emacs, but R will continue. 

Rainer

> 
> Best,
> 
> Tamas
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-09 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-04  7:22 ob-R ignores ess-eval-visibly? Tamas Papp
2015-09-09 19:30 ` Aaron Ecay
2015-09-09 21:10 ` Rainer M Krug

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