emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Babel: How to call code in one org file into another org file


From: briangpowell .
Subject: Re: [O] Babel: How to call code in one org file into another org file
Date: Fri, 30 Oct 2015 18:57:59 -0400

Could create a named pipe and have one org-mode file write to it and another org-mode file read from it.

On Fri, Oct 30, 2015 at 4:55 PM, Thomas S. Dye <address@hidden> wrote:
Aloha Lawrence,

Lawrence Bottorff <address@hidden> writes:

> There are many, many Babel examples, but I can't seem to find this
> functionality: A function in a Lisp code block in one org file is to be
> called from a Lisp code block in another org file. Is this possible? I know
> you can stick stuff into your personal "Library of Babel," but I just want
> to write a Lisp block that calls a function from another org file. I'll
> have SLIME running, of course.
>
>
> file1.org:
> ...
>  #+begin_src lisp
> (defun foo ()
>    (...))
> #+end_src
>
> is then called from. . .
>
> file2.org:
> ...
> #+begin_src lisp
> (defun baa ()
>   (foo))
> #+end_src

Any Org mode file can function as Library of Babel.  In your case,
(org-babel-lob-ingest path/to/file1.org) should do what you want.  Note
that org-babel-lob-ingest is bound to C-c C-v i.

hth,
Tom

--
Thomas S. Dye
http://www.tsdye.com



reply via email to

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