emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta (release_


From: Cook, Malcolm
Subject: Re: [O] [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta (release_8.3beta-362-ga92789 <at> /usr/local/share/emacs/site-lisp/org/)]
Date: Thu, 18 Sep 2014 21:13:18 +0000

Hi,

Hmm, I spoke too soon.... the problem is only partially fixed by this patch...

Trying to work with in org-mode with R code blocks attached to persistent 
sessions (i.e. adding ':session myRsession' to the code block header ) makes 
things start to break again, at least in my hands.

I'm going to wait till things settle down before trying to upgrade ESS again.

Thanks for the patch anyway.

Cheers,

Malcolm

 >-----Original Message-----
 >From: Cook, Malcolm
 >Sent: Wednesday, September 17, 2014 6:14 PM
 >To: 'Rainer M Krug'; 'Charles Berry'
 >Cc: 'address@hidden'
 >Subject: RE: [O] [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta 
 >(release_8.3beta-362-ga92789 <at>
 >/usr/local/share/emacs/site-lisp/org/)]
 >
 >Hiya,
 >
 >Likewise - same problem here is fixed with injection of patch.
 >
 >Thanks!
 >
 >~ malcolm_cook
 >
 >
 > >-----Original Message-----
 > >From: address@hidden [mailto:address@hidden On
 > >Behalf Of Rainer M Krug
 > >Sent: Wednesday, September 17, 2014 2:26 AM
 > >To: Charles Berry
 > >Cc: address@hidden
 > >Subject: Re: [O] [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta 
 > >(release_8.3beta-362-ga92789 <at>
 > >/usr/local/share/emacs/site-lisp/org/)]
 > >
 > >Rainer M Krug <address@hidden> writes:
 > >
 > >Using it, error is gone.
 > >
 > >Rainer
 > >
 > >> Charles Berry <address@hidden> writes:
 > >>
 > >>> Charles Berry <ccberry <at> ucsd.edu> writes:
 > >>>
 > >>>>
 > >>>> Rainer M Krug <Rainer <at> krugs.de> writes:
 > >>>>
 > >>>> >
 > >>>> > Thanks - you came before me. I get the same error but managed to work
 > >>>> > around.
 > >>>> >
 > >>>> > This is likely caused by the upgrade of ess,
 > >>>>
 > >>>> Likely.
 > >>>>
 > >>>> But it may not be an ESS problem per se.
 > >>>>
 > >>>> M-x R starts a process that runs asynchronously. In interactive use 
 > >>>> there
 > >>>> is no issue (barring something in .First() that slows the startup for
 > >>>> a very long time).
 > >>>>
 > >>>> But, ...
 > >>>>
 > >>>> If the  (rename-buffer ...) in org-babel-R-initiate-session
 > >>>> runs before all the setup that ESS performs in the process buffer is
 > >>>> complete, chaos can result.
 > >>>>
 > >>>> Not sure what the best way is to fix this.
 > >>>>
 > >>>
 > >>> OK. Looks like (ess-wait-for-process) fixes this. Here is a patch.
 > >>
 > >> Thanks.
 > >>
 > >> Haven't tried it yet, but I can't imagine any downside of this
 > >> patch. Could this be committed?
 > >>
 > >> Rainer
 > >>
 > >>>
 > >>> Chuck
 > >>> ==
 > >>>
 > >>> From 89472012d80ce9ad4c8722f304c0d29327efa1fc Mon Sep 17 00:00:00 2001
 > >>> From: chasberry <address@hidden>
 > >>> Date: Tue, 16 Sep 2014 19:57:59 -0700
 > >>> Subject: [PATCH] lisp/ob-R.el: use `ess-wait-for-process' to assure clean
 > >>>  session startup
 > >>>
 > >>> * lisp/ob-R.el (org-babel-R-initiate-session): Make sure that (R) has
 > >>> finished before `rename-buffer' is run.
 > >>>
 > >>> TINYCHANGE
 > >>> ---
 > >>>  lisp/ob-R.el | 3 +++
 > >>>  1 file changed, 3 insertions(+)
 > >>>
 > >>> diff --git a/lisp/ob-R.el b/lisp/ob-R.el
 > >>> index 41b943c..7575acf 100644
 > >>> --- a/lisp/ob-R.el
 > >>> +++ b/lisp/ob-R.el
 > >>> @@ -35,6 +35,8 @@
 > >>>  (declare-function inferior-ess-send-input "ext:ess-inf" ())
 > >>>  (declare-function ess-make-buffer-current "ext:ess-inf" ())
 > >>>  (declare-function ess-eval-buffer "ext:ess-inf" (vis))
 > >>> +(declare-function ess-wait-for-process "ext:ess-inf"
 > >>> +                  (&optional proc sec-prompt wait force-redisplay))
 > >>>  (declare-function org-number-sequence "org-compat" (from &optional to 
 > >>> inc))
 > >>>  (declare-function org-remove-if-not "org" (predicate seq))
 > >>>  (declare-function org-every "org" (pred seq))
 > >>> @@ -262,6 +264,7 @@ This function is called by 
 > >>> `org-babel-execute-src-block'."
 > >>>              ;; Session buffer exists, but with dead process
 > >>>              (set-buffer session))
 > >>>            (require 'ess) (R)
 > >>> +          (ess-wait-for-process)
 > >>>            (rename-buffer
 > >>>             (if (bufferp session)
 > >>>                 (buffer-name session)
 > >
 > >--
 > >Rainer M. Krug
 > >email: Rainer<at>krugs<dot>de
 > >PGP: 0x0F52F982



reply via email to

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