emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How does Library of Babel actually work?


From: John Kitchin
Subject: Re: [O] How does Library of Babel actually work?
Date: Sat, 31 Oct 2015 11:29:21 -0400

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

On Sat, Oct 31, 2015 at 11:10 AM, Lawrence Bottorff <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]