* How does Library of Babel actually work?
@ 2015-10-31 15:10 Lawrence Bottorff
2015-10-31 15:29 ` John Kitchin
2015-10-31 15:53 ` Nick Dokos
0 siblings, 2 replies; 4+ messages in thread
From: Lawrence Bottorff @ 2015-10-31 15:10 UTC (permalink / raw)
To: emacs-orgmode Mailinglist
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 903 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How does Library of Babel actually work?
2015-10-31 15:10 How does Library of Babel actually work? Lawrence Bottorff
@ 2015-10-31 15:29 ` John Kitchin
2015-10-31 15:53 ` Nick Dokos
1 sibling, 0 replies; 4+ messages in thread
From: John Kitchin @ 2015-10-31 15:29 UTC (permalink / raw)
To: Lawrence Bottorff; +Cc: emacs-orgmode Mailinglist
[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]
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 <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 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
>
>
>
[-- Attachment #2: Type: text/html, Size: 3078 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How does Library of Babel actually work?
2015-10-31 15:10 How does Library of Babel actually work? Lawrence Bottorff
2015-10-31 15:29 ` John Kitchin
@ 2015-10-31 15:53 ` Nick Dokos
2015-10-31 16:25 ` Lawrence Bottorff
1 sibling, 1 reply; 4+ messages in thread
From: Nick Dokos @ 2015-10-31 15:53 UTC (permalink / raw)
To: emacs-orgmode
Lawrence Bottorff <borgauf@gmail.com> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How does Library of Babel actually work?
2015-10-31 15:53 ` Nick Dokos
@ 2015-10-31 16:25 ` Lawrence Bottorff
0 siblings, 0 replies; 4+ messages in thread
From: Lawrence Bottorff @ 2015-10-31 16:25 UTC (permalink / raw)
To: Nick Dokos; +Cc: emacs-orgmode Mailinglist
[-- Attachment #1: Type: text/plain, Size: 1530 bytes --]
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 <ndokos@gmail.com> wrote:
> Lawrence Bottorff <borgauf@gmail.com> 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
>
>
>
[-- Attachment #2: Type: text/html, Size: 2321 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-31 16:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-31 15:10 How does Library of Babel actually work? Lawrence Bottorff
2015-10-31 15:29 ` John Kitchin
2015-10-31 15:53 ` Nick Dokos
2015-10-31 16:25 ` Lawrence Bottorff
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).