From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay 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: Fri, 10 Oct 2014 00:38:34 -0400 Message-ID: <874mvcy1x1.fsf@gmail.com> References: <87bnqgzljd.fsf@kademan.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcRyZ-0002dc-0H for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 00:38:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcRyP-0006Xs-VI for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 00:38:46 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:50841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcRyP-0006XW-Of for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 00:38:37 -0400 Received: by mail-wi0-f174.google.com with SMTP id cc10so830947wib.7 for ; Thu, 09 Oct 2014 21:38:36 -0700 (PDT) In-Reply-To: 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: Henrik Singmann , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi Henrik, 2014ko urriak 8an, Henrik Singmann-ek idatzi zuen: > > I unfortunately can confirm that org-babel-R-initiate-session contains > the lines you mentioned at exactly 15 lines down. Deleting ob-R.elc > (which was of the same date as ob-R.el) didn't affect anything as did > reloading org uncompiled (C-u C-c C-x !). I could reproduce this, also with recent git org and ESS. It looks like ESS is doing more complicated things, necessitating a more thorough check that the session is in fact ready. Can you test the attached patch? It fixed the problem for me. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ob-R-fix-interaction-with-ESS-for-new-sessions.patch >From b91526d932728749609b27809eecb588c04e1a1e Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Fri, 10 Oct 2014 00:35:41 -0400 Subject: [PATCH] ob-R: fix interaction with ESS for new sessions * lisp/ob-R.el (org-babel-R-initiate-session): Properly wait on a new ESS process. --- lisp/ob-R.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index ea33031..5d5006f 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -265,9 +265,10 @@ 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 - (get-process (or ess-local-process-name - ess-current-process-name))) + (let ((R-proc (get-process (or ess-local-process-name + ess-current-process-name)))) + (while (process-get R-proc 'callbacks) + (ess-wait-for-process R-proc))) (rename-buffer (if (bufferp session) (buffer-name session) -- 2.1.2 --=-=-= Content-Type: text/plain Thanks, -- Aaron Ecay --=-=-=--