From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Brown Subject: Re: Error Embedding SQL Source from code block into R Source of Another (noweb) Date: Tue, 30 Sep 2014 12:02:16 -0500 Message-ID: <87h9zpt52f.fsf@air.ben-zion.org> References: <87lhp2x7p9.fsf@air.ben-zion.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ0oi-00058f-Gp for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 13:02:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZ0od-00048a-AW for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 13:02:24 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:59190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ0od-00047p-2c for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 13:02:19 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by gateway2.nyi.internal (Postfix) with ESMTP id 8E9C521129 for ; Tue, 30 Sep 2014 13:02:18 -0400 (EDT) In-Reply-To: (Charles Berry's message of "Tue, 30 Sep 2014 15:08:36 +0000 (UTC)") 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 Charles Berry writes: > Hmmm. Maybe the bug that was fixed by commit > > 0fd29a5ee7d14c3695b22998196373b9a3637413 > > about two weeks back? Make sure ob-R.el is up to date and compiled (or > that ob-R.elc is deleted). > > > Anyway, your code works as expected for me - first time. > > --- > > FWIW, I prefer to use :var headers to import strings, but it takes some > setup: > > > > #+BEGIN_SRC emacs-lisp > (defun grab-src (name) > (save-excursion > (org-babel-goto-named-src-block name) > (nth 1 (org-babel-get-src-block-info 'light)))) > #+END_SRC > > #+BEGIN_SRC R :var y=(grab-src "sqlsource") :results output :exports both > y > #+END_SRC > > #+RESULTS: > : [1] "select \n * \nfrom \n t \nlimit \n 10" > In fact M-x R before evaluation did fix things. I will try to get the org source going, which contains the fix. Otherwise, I might be content to wait for the fix to make its way into org ELPA. (I'm on .emacs complexity overload) Great idea about the grab-src function! Worked like a charm. Thanks again, Eric