From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: How does Library of Babel actually work? Date: Sat, 31 Oct 2015 15:10:51 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b342c8e253202052367f30e Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsXnx-0001UJ-SG for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:10:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsXnw-0003lI-ND for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:10:53 -0400 Received: from mail-lb0-x22f.google.com ([2a00:1450:4010:c04::22f]:34352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsXnw-0003l5-G7 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:10:52 -0400 Received: by lbbwb3 with SMTP id wb3so64756361lbb.1 for ; Sat, 31 Oct 2015 08:10:51 -0700 (PDT) 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: emacs-orgmode Mailinglist --047d7b342c8e253202052367f30e Content-Type: text/plain; charset=UTF-8 New thread. Anyway, putting lisp/SLIME aside, I experimented with emacs lisp -- and got the same results, i.e., no real LOB functionality, despite proper loading. I must be doing something wrong? I'll describe my process again: Load a.org and b.org into `org-babel-library-of-babel` with `org-babel-lob-ingest`. Good. Check -- and yes, both functions are in `org-babel-library-of-babel` and seem to be ready and "live." But when I try to call them in c.org, org-mode has no knowledge of them. Then I try #+call and #+lob on a b.org function. Still no knowledge of it. At this point I'm not sure LOB works -- or I have a mistaken idea of what it is and what it does. LB --047d7b342c8e253202052367f30e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
New thread. Anyway, putting lisp/SLIME aside, I experiment= ed with emacs lisp -- and got the same results, i.e., no real LOB functiona= lity, despite proper loading. I must be doing something wrong? I'll des= cribe my process again:

Load a.= org and b.org into=C2=A0`org-babel-library= -of-babel` with `org-babel-lob-ingest`. Good. Check -- and yes, both functi= ons are in=C2=A0`org-babel-library-of-babel` and seem to be ready and "= ;live." But when I try to call them in c.org<= /a>, org-mode has no knowledge of them. Then I try #+call and #+lob on a b.org function. Still no knowledge of it. At thi= s point I'm not sure LOB works -- or I have a mistaken idea of what it = is and what it does.

LB

--047d7b342c8e253202052367f30e-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: How does Library of Babel actually work? Date: Sat, 31 Oct 2015 11:29:21 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e010d8ab2519a1405236835a1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsY5s-0004TA-5N for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:29:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsY5q-0007dE-NC for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:29:24 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:33256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsY5q-0007cv-5p for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:29:22 -0400 Received: by wijp11 with SMTP id p11so27709972wij.0 for ; Sat, 31 Oct 2015 08:29:21 -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: Lawrence Bottorff Cc: emacs-orgmode Mailinglist --089e010d8ab2519a1405236835a1 Content-Type: text/plain; charset=UTF-8 I think you are mistaken in what you think it does. I am pretty sure what it does is allow you to call named src-blocks with this syntax: #+call: some-func-in-lob(args) It doesn't make the functions in the code blocks necessarily available in another code block (although through side effects for emacs-lisp, that might happen). I think what you want (this works for emacs-lisp) is a file, say f1.org containing #+BEGIN_SRC emacs-lisp :tangle f1.el (defun mfe () 8) #+END_SRC Then, in another file you can do: #+BEGIN_SRC emacs-lisp (org-babel-load-file "f1.org") (mfe) #+END_SRC and you will get 8. org-babel-load This isn't possible in other languages. You can of course have an elisp block to tangle f1.org, and then if it was python, for example, you could import the functions in a python block. John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Sat, Oct 31, 2015 at 11:10 AM, Lawrence Bottorff wrote: > New thread. Anyway, putting lisp/SLIME aside, I experimented with emacs > lisp -- and got the same results, i.e., no real LOB functionality, despite > proper loading. I must be doing something wrong? I'll describe my process > again: > > Load a.org and b.org into `org-babel-library-of-babel` with > `org-babel-lob-ingest`. Good. Check -- and yes, both functions are > in `org-babel-library-of-babel` and seem to be ready and "live." But when I > try to call them in c.org, org-mode has no knowledge of them. Then I try > #+call and #+lob on a b.org function. Still no knowledge of it. At this > point I'm not sure LOB works -- or I have a mistaken idea of what it is and > what it does. > > LB > > > --089e010d8ab2519a1405236835a1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I think you are mistaken in what you think it does. I am p= retty sure what it does is allow you to call named src-blocks with this syn= tax:

#+call: some-func-in-lob(args)

=
It doesn't make the functions in the code blocks necessarily avail= able in another code block (although through side effects for =C2=A0emacs-l= isp, that might happen).

I think what you want (th= is works for emacs-lisp)

is a file, say f1.org containing

#+BEGIN= _SRC emacs-lisp :tangle f1.el
(defun mfe () 8)
#+END_SR= C


Then, in another file you c= an do:
#+BEGIN_SRC emacs-lisp
(org-babel-load-file= "f1.org")
(mfe)
#+END_SRC

and you will get 8. org-babel-lo= ad

This isn't possible in other languages. You= can of course have an elisp block to tangle f1.o= rg, and then if it was python, for example, you could import the functi= ons in a python block.


John

-----------------------------------
Profe= ssor John Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical Eng= ineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7= 803

On Sat, Oct 31, 2015 at 11:10 AM, Lawrence B= ottorff <borgauf@gmail.com> wrote:
New thread. Anyway, putting lisp/SLIME aside, I= experimented with emacs lisp -- and got the same results, i.e., no real LO= B functionality, despite proper loading. I must be doing something wrong? I= 'll describe my process again:

Load a.org and b.org into=C2=A0`org-babel-library-of-babel` with `org-babel-l= ob-ingest`. Good. Check -- and yes, both functions are in=C2=A0`org-babel-l= ibrary-of-babel` and seem to be ready and "live." But when I try = to call them in c.org, org-m= ode has no knowledge of them. Then I try #+call and #+lob on a b.org function. Still no knowledge of it= . At this point I'm not sure LOB works -- or I have a mistaken idea of = what it is and what it does.

LB


=

--089e010d8ab2519a1405236835a1-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: How does Library of Babel actually work? Date: Sat, 31 Oct 2015 11:53:59 -0400 Message-ID: <87fv0r825k.fsf@pierrot.dokosmarshall.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsYU2-0008Dc-VZ for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:54:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsYTz-0004mS-Q9 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:54:22 -0400 Received: from plane.gmane.org ([80.91.229.3]:44612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsYTz-0004mO-Jg for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:54:19 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZsYTx-00049N-G7 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 16:54:17 +0100 Received: from pool-108-20-41-232.bstnma.fios.verizon.net ([108.20.41.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 31 Oct 2015 16:54:17 +0100 Received: from ndokos by pool-108-20-41-232.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 31 Oct 2015 16:54:17 +0100 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: emacs-orgmode@gnu.org Lawrence Bottorff writes: > New thread. Anyway, putting lisp/SLIME aside, I experimented with emacs lisp -- and got > the same results, i.e., no real LOB functionality, despite proper loading. I must be doing > something wrong? I'll describe my process again: > > Load a.org and b.org into `org-babel-library-of-babel` with `org-babel-lob-ingest`. Good. > Check -- and yes, both functions are in `org-babel-library-of-babel` and seem to be ready > and "live." But when I try to call them in c.org, org-mode has no knowledge of them. Then > I try #+call and #+lob on a b.org function. Still no knowledge of it. At this point I'm > not sure LOB works -- or I have a mistaken idea of what it is and what it does. > org-babel-lob-ingest adds files to the LOB (i.e. it's as if you had the code blocks in your file explicitly). But you still need to define the function, i.e. evaluate the code block. IOW, you need to call (org-sbe "func") in the buffer where you are going to use "func" I think. See my other post re. your lisp/slime attempts. -- Nick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: How does Library of Babel actually work? Date: Sat, 31 Oct 2015 16:25:15 +0000 Message-ID: References: <87fv0r825k.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11410c323463f0052368fd1e Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsYxx-0002fb-CZ for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:25:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsYxw-0003P3-At for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:25:17 -0400 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]:33994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsYxv-0003Ox-V7 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:25:16 -0400 Received: by lfgh9 with SMTP id h9so260295lfg.1 for ; Sat, 31 Oct 2015 09:25:15 -0700 (PDT) In-Reply-To: <87fv0r825k.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 --001a11410c323463f0052368fd1e Content-Type: text/plain; charset=UTF-8 Yes, and see my response. Having to explicitly re-do the `org-babel-lob-ingest` in the Local Variables with an eval tells me org babel doesn't really know about LOB until my file explicitly tells it. Doing `org-babel-lob-ingest` outside of the org file (at Emacs startup) should set something to t and org babel should be happy. On Sat, Oct 31, 2015 at 3:53 PM, Nick Dokos wrote: > Lawrence Bottorff writes: > > > New thread. Anyway, putting lisp/SLIME aside, I experimented with emacs > lisp -- and got > > the same results, i.e., no real LOB functionality, despite proper > loading. I must be doing > > something wrong? I'll describe my process again: > > > > Load a.org and b.org into `org-babel-library-of-babel` with > `org-babel-lob-ingest`. Good. > > Check -- and yes, both functions are in `org-babel-library-of-babel` and > seem to be ready > > and "live." But when I try to call them in c.org, org-mode has no > knowledge of them. Then > > I try #+call and #+lob on a b.org function. Still no knowledge of it. > At this point I'm > > not sure LOB works -- or I have a mistaken idea of what it is and what > it does. > > > > org-babel-lob-ingest adds files to the LOB (i.e. it's as if you had the > code blocks in your file explicitly). But you still need to define the > function, i.e. evaluate the code block. IOW, you need to call (org-sbe > "func") in the buffer where you are going to use "func" I think. See my > other post re. your lisp/slime attempts. > > -- > Nick > > > --001a11410c323463f0052368fd1e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yes, and see my response. Having to explicitly re-do the `= org-babel-lob-ingest` in the Local Variables with an eval tells me org babe= l doesn't really know about LOB until my file explicitly tells it. Doin= g `org-babel-lob-ingest` outside of the org file (at Emacs startup) should = set something to t and org babel should be happy.

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

> New thread. Anyway, putting lisp/SLIME aside, I experimented with emac= s lisp -- and got
> the same results, i.e., no real LOB functionality, despite proper load= ing. I must be doing
> something wrong? I'll describe my process again:
>
> Load a.o= rg and b.= org into=C2=A0`org-babel-library-of-babel` with `org-babel-lob-ingest`.= Good.
> Check -- and yes, both functions are in=C2=A0`org-babel-library-of-bab= el` and seem to be ready
> and "live." But when I try to call them in c.org, org-mode has no kno= wledge of them. Then
> I try #+call and #+lob on a b.org function. Still no knowledge of it. At this p= oint I'm
> not sure LOB works -- or I have a mistaken idea of what it is and what= it does.
>

org-babel-lob-ingest adds files to the LOB (i.e. it's as if you = had the
code blocks in your file explicitly). But you still need to define the
function, i.e. evaluate the code block. IOW, you need to call (org-sbe
"func") in the buffer where you are going to use "func"= I think. See my
other post re. your lisp/slime attempts.

--
Nick



--001a11410c323463f0052368fd1e--