From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: Babel: How to call code in one org file into another org file Date: Sat, 31 Oct 2015 16:51:07 +0000 Message-ID: References: <87oaff82pv.fsf@pierrot.dokosmarshall.org> <87bnbf80ar.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114128acbc000e0523695901 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsZMz-0006hH-Vt for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:51:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsZMy-0000pN-MC for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:51:09 -0400 Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:33431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsZMy-0000pD-8L for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:51:08 -0400 Received: by lfbf136 with SMTP id f136so32941732lfb.0 for ; Sat, 31 Oct 2015 09:51:07 -0700 (PDT) In-Reply-To: <87bnbf80ar.fsf@pierrot.dokosmarshall.org> 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: Nick Dokos Cc: emacs-orgmode Mailinglist --001a114128acbc000e0523695901 Content-Type: text/plain; charset=UTF-8 I guess I'm saying that the whole `org-babel-lob-ingest` into `org-babel-library-of-babel` exercise should make code ready and available. Otherwise (especially with the extra `org-babel-lob-ingest` in Local Variable step I mentioned), what John Kitchin suggested with `org-babel-load-file` is just as good, i.e., LOB seems hardly worth it. My whole motivation is to avoid having to scroll through endless code blocks all on the same level, rather, to have things more modular and distributed, a bit like DDLs in MS-land. On Sat, Oct 31, 2015 at 4:34 PM, Nick Dokos wrote: > Lawrence Bottorff writes: > > > Yes, I experimented with this too -- and got it to work. But strangely, > if you leave out the > > > > # eval: (org-babel-lob-ingest "./a.org") > > # eval: (org-babel-lob-ingest "./b.org") > > > > lines and do a regular `org-babel-lob-ingest` (or C-c C-v i) on those > > two files -- it doesn't work. Rather bizarre behavior, IMHO. > > > > I think you have some misconceptions about what org-babel-lob-ingest > does. All it does is go through the file and add the named source > blocks in that file to org-babel-library-of-babel: it does *not* > evaluate the code blocks. So if the code block is e.g. a lisp code > block with a defun in it, the function is *not* defined, until the > code block is evaluated by org-babel: that's what org-sbe does. > > > Anyway, the dream behavior for LOB would be to simply add your files to > your `org-babel-lob-files` in your Emacs init, start up an org file -- and > be able to simply use all the LOB > > files in your "live" `org-babel-library-of-babel` list library. > > > > You can do that but again all that does is populate a list that > only org-babel knows about. You'd still need to evaluate the code > blocks in order to tell the inferior lisp process about what the > code block define. > > -- > Nick > > > --001a114128acbc000e0523695901 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I guess I'm saying that the whole `org-babel-lob-inges= t` into `org-babel-library-of-babel` exercise should make code ready and av= ailable. Otherwise (especially with the extra=C2=A0`org-babel-lob-ingest` i= n Local Variable step I mentioned), what=C2=A0John Kitchin suggested with `= org-babel-load-file` is just as good, i.e., LOB seems hardly worth it. My w= hole motivation is to avoid having to scroll through endless code blocks al= l on the same level, rather, to have things more modular and distributed, a= bit like DDLs in MS-land.

On Sat, Oct 31, 2015 at 4:34 PM, Nick Dokos <ndokos@gmail.= com> wrote:
Lawrence Bottorff <borgauf@gmail.= com> writes:

> Yes, I experimented with this too -- and got it to work. But strangely= , if you leave out the=C2=A0
>
> # eval: (org-babel-lob-ingest "./a.org")
> # eval: (org-babel-lob-ingest "./b.org")
>
> lines and do a regular `org-babel-lob-ingest` (or =C2=A0C-c C-v i) on = those
> two files -- it doesn't work. Rather bizarre behavior, IMHO.
>

I think you have some misconceptions about what org-babel-lob-ingest=
does. All it does is go through the file and add the named source
blocks in that file to org-babel-library-of-babel: it does *not*
evaluate the code blocks. So if the code block is e.g. a lisp code
block with a defun in it, the function is *not* defined, until the
code block is evaluated by org-babel: that's what org-sbe does.

> Anyway, the dream behavior for LOB would be to simply add your files t= o your `org-babel-lob-files` in your Emacs init, start up an org file -- an= d be able to simply use all the LOB
> files in your "live" `org-babel-library-of-babel` list libra= ry.
>

You can do that but again all that does is populate a list that
only org-babel knows about. You'd still need to evaluate the code
blocks in order to tell the inferior lisp process about what the
code block define.

--
Nick



--001a114128acbc000e0523695901--