From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta (release_8.3beta-362-ga92789 /usr/local/share/emacs/site-lisp/org/)] Date: Wed, 17 Sep 2014 09:26:21 +0200 Message-ID: References: <87bnqgzljd.fsf@kademan.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XU9dM-00037S-7P for emacs-orgmode@gnu.org; Wed, 17 Sep 2014 03:26:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XU9dF-0003W6-GP for emacs-orgmode@gnu.org; Wed, 17 Sep 2014 03:26:36 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:62442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XU9dF-0003Vm-Ai for emacs-orgmode@gnu.org; Wed, 17 Sep 2014 03:26:29 -0400 Received: by mail-we0-f182.google.com with SMTP id k48so960105wev.27 for ; Wed, 17 Sep 2014 00:26:25 -0700 (PDT) In-Reply-To: (Rainer M. Krug's message of "Wed, 17 Sep 2014 09:20:14 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Charles Berry Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Rainer M Krug writes: Using it, error is gone. Rainer > Charles Berry writes: > >> Charles Berry ucsd.edu> writes: >> >>>=20 >>> Rainer M Krug krugs.de> writes: >>>=20 >>> >=20 >>> > Thanks - you came before me. I get the same error but managed to work= =20 >>> > around. >>> >=20 >>> > This is likely caused by the upgrade of ess,=20 >>>=20 >>> Likely. >>>=20 >>> But it may not be an ESS problem per se.=20 >>>=20 >>> M-x R starts a process that runs asynchronously. In interactive use the= re=20 >>> is no issue (barring something in .First() that slows the startup for >>> a very long time). >>>=20 >>> But, ... >>>=20 >>> If the (rename-buffer ...) in org-babel-R-initiate-session >>> runs before all the setup that ESS performs in the process buffer is=20 >>> complete, chaos can result. >>>=20 >>> 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 >> =3D=3D >> >> From 89472012d80ce9ad4c8722f304c0d29327efa1fc Mon Sep 17 00:00:00 2001 >> From: chasberry >> 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"=20 >> + (&optional proc sec-prompt wait force-redisplay)) >> (declare-function org-number-sequence "org-compat" (from &optional to i= nc)) >> (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-bl= ock'." >> ;; 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) =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUGTeeAAoJENvXNx4PUvmCWDkH/RzlBAjPsgpWfDsu87dr6OIF EbM9ka0l4gzgcj8N4PS7s0ZinVofaSIul/ATP6wrzPKRoQYMqCgbZAp5uC0liZMN WKfmKolnngUru//sIlWwW+Dflkw3lDrbvrSryPXFgC2weJfZwnLlUvgx3p5S/tQL uq05HPmmJtV6D8529E5njY975tuglD8aMhLII3O1erKLdQ9s1a/oPeq8W4+8Pktc tm3y/xZiI2q8LwpaP1FU1hEqM0n0Uqhd8EELlSUnzd4qK74/WvPVlVUYh6uUPSoY 8mTCtyeaoouWITeEBe4TlA5R/LfXs0N48H0g5Udtb2pZxbnh0NrMIXL2b+5ssKs= =IuA3 -----END PGP SIGNATURE----- --=-=-=--