From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Babel: How to call code in one org file into another org file Date: Fri, 30 Oct 2015 20:21:53 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3eebca7315d0523582d47 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsGBQ-0004IG-09 for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 16:21:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsGBP-0006RA-0P for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 16:21:56 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:33403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsGBO-0006Qx-Oq for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 16:21:54 -0400 Received: by lfbf136 with SMTP id f136so24568977lfb.0 for ; Fri, 30 Oct 2015 13:21:53 -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 --001a11c3eebca7315d0523582d47 Content-Type: text/plain; charset=UTF-8 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 LB --001a11c3eebca7315d0523582d47 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 possib= le? I know you can stick stuff into your personal "Library of Babel,&q= uot; but I just want to write a Lisp block that calls a function from anoth= er org file. I'll have SLIME running, of course.

...
=
=C2=A0#+begin_src lisp
(defun foo ()
=C2=A0 = =C2=A0(...))
#+end_src

is then calle= d from. . .

...
#+begin_src lisp
(defun baa ()<= /div>
=C2=A0 (foo))
#+end_src

LB
--001a11c3eebca7315d0523582d47-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Babel: How to call code in one org file into another org file Date: Fri, 30 Oct 2015 16:53:47 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsGgM-0000lW-Ai for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 16:53:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsGgI-0006vw-88 for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 16:53:54 -0400 Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:36042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsGgI-0006vs-3a for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 16:53:50 -0400 Received: by qgad10 with SMTP id d10so71864825qga.3 for ; Fri, 30 Oct 2015 13:53:49 -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 I don't think this is possible. You probably need some tangling and loading to make it happen the way I understand it. Lawrence Bottorff 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 > > > LB -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas S. Dye Subject: Re: Babel: How to call code in one org file into another org file Date: Fri, 30 Oct 2015 10:55:57 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsGic-0002WP-4t for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 16:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsGiY-0007GS-S6 for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 16:56:14 -0400 Received: from gproxy8-pub.mail.unifiedlayer.com ([67.222.33.93]:37586) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZsGiY-0007Ex-M7 for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 16:56:10 -0400 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 Aloha Lawrence, Lawrence Bottorff 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "briangpowell ." Subject: Re: Babel: How to call code in one org file into another org file Date: Fri, 30 Oct 2015 18:57:59 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113ce9d8eaa0a705235a5b0c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsIcT-00025p-U8 for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 18:58:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsIcS-0003sU-Ir for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 18:58:01 -0400 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:36498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsIcS-0003sH-EM for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 18:58:00 -0400 Received: by oiao187 with SMTP id o187so67871853oia.3 for ; Fri, 30 Oct 2015 15:57:59 -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: "Thomas S. Dye" Cc: emacs-orgmode Mailinglist , Lawrence Bottorff --001a113ce9d8eaa0a705235a5b0c Content-Type: text/plain; charset=UTF-8 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 wrote: > Aloha Lawrence, > > Lawrence Bottorff 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 > > --001a113ce9d8eaa0a705235a5b0c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 <tsd@tsdye.com> wrote:
= Aloha Lawrence,

Lawrence Bottorff <borgauf@gmail.co= m> 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 b= e
> 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," b= ut I just want
> to write a Lisp block that calls a function from another org file. I&#= 39;ll
> have SLIME running, of course.
>
>
> file= 1.org:
> ...
>=C2=A0 #+begin_src lisp
> (defun foo ()
>=C2=A0 =C2=A0 (...))
> #+end_src
>
> is then called from. . .
>
> file= 2.org:
> ...
> #+begin_src lisp
> (defun baa ()
>=C2=A0 =C2=A0(foo))
> #+end_src

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

hth,
Tom

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


--001a113ce9d8eaa0a705235a5b0c-- 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 00:14:52 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11401f0eda9c6505235b6e7a Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsJot-0008H3-5o for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 20:14:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsJor-0005PB-NZ for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 20:14:55 -0400 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:34261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsJor-0005ON-Ax for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 20:14:53 -0400 Received: by lfaz124 with SMTP id z124so42534577lfa.1 for ; Fri, 30 Oct 2015 17:14:52 -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: emacs-orgmode Mailinglist --001a11401f0eda9c6505235b6e7a Content-Type: text/plain; charset=UTF-8 Doing M-x org-babel-lob-files called up a customization buffer that allowed me to put in many separate file paths. I did this for ../a.org and ../b.org. a.org: #+name: myadd #+begin_src lisp :session (defun myadd (x y) (+ x y)) #+end_src b.org: #+name: multi_x2 #+begin_src lisp :session (defun multi_x2 (x) (* 2 x)) #+end_src then in c.org: #+name: add&multi_x2 #+begin_src lisp :session (defun add&multi_x2 (x y) (multi_x2 (myadd x y))) #+end_src but upon C-c C-c in c.org SLIME didn't know about myadd or multi_x2 ... until I did C-c C-c in both a.org and b.org for the respective functions. Then c.org's add&multi_x2 knew about the helper functions. That is wonderful and allows a very distributed and modular approach to org-mode LP for Lisp. However, it would be nice if I didn't have to acquaint my SLIME session by hand all of my ingested babel-lob files. Any way to have this happen automatically upon C-c C-c-ing my main org file? I found this discussion, but I don't believe it really addresses my wish. LB On Fri, Oct 30, 2015 at 8:55 PM, Thomas S. Dye wrote: > Aloha Lawrence, > > Lawrence Bottorff 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 > --001a11401f0eda9c6505235b6e7a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Doing M-x org-babel-lob-files called up a customization bu= ffer that allowed me to put in many separate file paths. I did this for ../= a.org and ../b.org.


#+name: myadd
#+begin_src lisp :session
(d= efun myadd (x y)
=C2=A0 (+ x y))
#+end_src
<= div>

=
#+name: multi_x2
#+begin_src lisp :session
(d= efun multi_x2 (x)
=C2=A0 (* 2 x))
#+end_src
=

then in c.org:
<= br>
#+name: add&multi_x2
#+begin_src lisp :ses= sion
(defun add&multi_x2 (x y)
=C2=A0 (multi_x2 (my= add x y)))
#+end_src

but upon C-c = C-c in c.org SLIME didn't know about myadd= or multi_x2 ... until I did C-c C-c in both a.org= and b.org for the respective functions. T= hen c.org's add&multi_x2 knew about th= e helper functions. That is wonderful and allows a very distributed and mod= ular approach to org-mode LP for Lisp. However, it would be nice if I didn&= #39;t have to acquaint my SLIME session by hand all of my ingested babel-lo= b files. Any way to have this happen automatically upon C-c C-c-ing my main= org file? I found=C2=A0this=C2=A0discussion, but I don't b= elieve it really addresses my wish.

LB
<= br>


On Fri, Oct 30, 2015 at 8:55 PM, Thomas S. Dye <tsd@tsdye.com= > wrote:
Aloha Lawrence,

Lawrence Bottorff <borgauf@gmail.co= m> 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 b= e
> 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," b= ut I just want
> to write a Lisp block that calls a function from another org file. I&#= 39;ll
> have SLIME running, of course.
>
>
> file= 1.org:
> ...
>=C2=A0 #+begin_src lisp
> (defun foo ()
>=C2=A0 =C2=A0 (...))
> #+end_src
>
> is then called from. . .
>
> file= 2.org:
> ...
> #+begin_src lisp
> (defun baa ()
>=C2=A0 =C2=A0(foo))
> #+end_src

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

hth,
Tom

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

--001a11401f0eda9c6505235b6e7a-- 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 02:12:20 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11401f0ef2419d05235d122c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsLeY-0002Sn-Vt for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:12:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsLeX-000518-Jb for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:12:22 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:35881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsLeX-000511-7p for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:12:21 -0400 Received: by lffz202 with SMTP id z202so42738179lff.3 for ; Fri, 30 Oct 2015 19:12:20 -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: emacs-orgmode Mailinglist --001a11401f0ef2419d05235d122c Content-Type: text/plain; charset=UTF-8 In my init file I have (custom-set-variables . . . '(org-babel-lob-files (quote ("/home/hercynian/org/babeltest/a.org" "/home/hercynian/org/babeltest/ b.org"))) that, of course, lasted an Emacs reboot after I had set them with customization. But then right after Emacs reboot, looking into the contents of `org-babel-library-of-babel`, I do not see the "association list" of the entire code blocks of a.org and b.org as I did in the last Emacs/org-mode session when I ran `org-babel-lob-ingest` on a.org and b.org. So `org-babel-library-of-babel` is populated only through `org-babel-lob-ingest`. Next question was, Does code alive in the current `org-babel-library-of-babel` make it live and ready to use? Apparently not. Experimenting has shown that starting Emacs not only does not auto-populate `org-babel-library-of-babel`, but even when I do a `org-babel-lob-ingest` on a.org and b.org, SLIME takes no notice and fails to see the functions in a.org and b.org. Here's my `org-babel-library-of-babel`: Value: ((multi_x2 "lisp" "(defun multi_x2 (x)\n (* 2 x))" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results . "replace") (:session) (:hlines . "no")) "" "multi_x2" 0 18) (myadd "lisp" "(defun myadd (x y)\n (+ x y))" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results . "replace") (:session) (:hlines . "no")) "" "myadd" 0 15)) which seems like my code block in c.org should know about them, right? No. Again, Babel LOB seems to have forgotten to tell SLIME the good news. But then maybe I need to say something specific in my add&multi_x2 code block about these helper functions I've got in a.org and b.org? --001a11401f0ef2419d05235d122c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

In my init file I have

(= custom-set-variables
=C2=A0 . . .
=C2=A0 =C2=A0'= ;(org-babel-lob-files
=C2=A0 =C2=A0(quote
=C2=A0 =C2=A0= ("/home/hercynian/org/babeltest/a.org&qu= ot; "/home/hercynian/org/babeltest/b.org&= quot;)))

that, of course, lasted an Emacs reboot a= fter I had set them with customization. But then right after Emacs reboot, = looking into the contents of `org-babel-library-of-babel`, I do not see the= "association list" of the entire code blocks of a.org and b.org as I did in the l= ast Emacs/org-mode session when I ran `org-babel-lob-ingest` on a.org and b.org. So `org-bab= el-library-of-babel` is populated only through=C2=A0`org-babel-lob-ingest`.= Next question was, Does code alive in the current `org-babel-library-of-ba= bel` make it live and ready to use? Apparently not. Experimenting has shown= that starting Emacs not only does not auto-populate=C2=A0`org-babel-librar= y-of-babel`, but even when I do a=C2=A0`org-babel-lob-ingest` on a.org and b.org, SLIME take= s no notice and fails to see the functions in a.or= g and b.org.

Here= 's my `org-babel-library-of-babel`:

Value: ((multi_x2 "li= sp" "(defun multi_x2 (x)\n =C2=A0(* 2 x))"
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((:comments . "")
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:shebang . "")
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:cache . "no")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:padline . "")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:noweb . "no")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:tangle . "no"= ;)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:exports . "co= de")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:results . &= quot;replace")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:s= ession)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:hlines . &quo= t;no"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0""= ; "multi_x2" 0 18)
=C2=A0(myadd "lisp" "= (defun myadd (x y)\n =C2=A0(+ x y))"
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 ((:comments . "")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(:shebang . "")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(:cache . "no")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(:= padline . "")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(:noweb= . "no")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(:tangle . &= quot;no")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(:exports . &quo= t;code")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(:results . "= ;replace")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(:session)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(:hlines . "no"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "" "myadd" 0 15))
<= /div>

which seems like my code block in c.org should know about them, right? No. Again, Babel LOB seem= s to have forgotten to tell SLIME the good news. But then maybe I need to s= ay something specific in my add&multi_x2 code block about these helper = functions I've got in a.org and b.org?

--001a11401f0ef2419d05235d122c-- 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 02:15:06 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113fb47ad7f59f05235d1c6b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsLhE-00039D-0J for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:15:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsLhD-0005sw-BJ for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:15:07 -0400 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:33005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsLhD-0005sh-4h for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:15:07 -0400 Received: by lfbf136 with SMTP id f136so28687180lfb.0 for ; Fri, 30 Oct 2015 19:15:06 -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: emacs-orgmode Mailinglist --001a113fb47ad7f59f05235d1c6b Content-Type: text/plain; charset=UTF-8 @John Kitchin: I can't seem to find a `org-babel-load-file`. --001a113fb47ad7f59f05235d1c6b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
@John Kitchin: I can't seem to find a `org-babel-load-= file`.
=C2=A0

--001a113fb47ad7f59f05235d1c6b-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Babel: How to call code in one org file into another org file Date: Fri, 30 Oct 2015 22:24:24 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--_com.android.email_2682303951971550" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsLqI-0004PK-S9 for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:24:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsLqF-0007Kj-P0 for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:24:30 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:33122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsLqF-0007Jz-KC for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:24:27 -0400 Received: by qkdl128 with SMTP id l128so12959916qkd.0 for ; Fri, 30 Oct 2015 19:24:27 -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: Lawrence Bottorff , "emacs-orgmode@gnu org" ----_com.android.email_2682303951971550 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 T2RkLiBJIGZvdW5kIHRoaXMgSSB3cm90ZSBiZWZvcmUgaHR0cDovL2tpdGNoaW5ncm91cC5jaGVt ZS5jbXUuZWR1L2Jsb2cvMjAxNC8wNi8yNC9Vc2luZy1vcmctZmlsZXMtbGlrZS1lbC1maWxlcy8K CldoYXQgb3JnIHZlcnNpb24gZG8geW91IGhhdmU/CgpPbiBPY3RvYmVyIDMwLCAyMDE1LCBhdCAx MDoxNSBQTSwgTGF3cmVuY2UgQm90dG9yZmYgPGJvcmdhdWZAZ21haWwuY29tPiB3cm90ZToKCkBK b2huIEtpdGNoaW46IEkgY2FuJ3Qgc2VlbSB0byBmaW5kIGEgYG9yZy1iYWJlbC1sb2FkLWZpbGVg LgoKwqAKCgo= ----_com.android.email_2682303951971550 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 PHN0eWxlPkBmb250LWZhY2V7Zm9udC1mYW1pbHk6Q2FsaWJyaTtwYW5vc2UtMToyIDE1IDUgMiAy IDIgNCAzIDIgNDt9PC9zdHlsZT48Zm9udCBmYWNlPSJDYWxpYnJpIj48cCBkaXI9Imx0ciI+T2Rk LiBJIGZvdW5kIHRoaXMgSSB3cm90ZSBiZWZvcmUgaHR0cDovL2tpdGNoaW5ncm91cC5jaGVtZS5j bXUuZWR1L2Jsb2cvMjAxNC8wNi8yNC9Vc2luZy1vcmctZmlsZXMtbGlrZS1lbC1maWxlcy88L3A+ CjxwIGRpcj0ibHRyIj5XaGF0IG9yZyB2ZXJzaW9uIGRvIHlvdSBoYXZlPzwvcD4KPGJyPjxicj5P biBPY3RvYmVyIDMwLCAyMDE1LCBhdCAxMDoxNSBQTSwgTGF3cmVuY2UgQm90dG9yZmYgJmx0O2Jv cmdhdWZAZ21haWwuY29tJmd0OyB3cm90ZTo8YnI+PGJyPjxicj48L2ZvbnQ+PGRpdiBkaXI9Imx0 ciI+QEpvaG4gS2l0Y2hpbjogSSBjYW4mIzM5O3Qgc2VlbSB0byBmaW5kIGEgYG9yZy1iYWJlbC1s b2FkLWZpbGVgLjxkaXYgY2xhc3M9ImdtYWlsX2V4dHJhIj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90 ZSI+PGRpdj7CoDwvZGl2PjwvZGl2Pjxicj48L2Rpdj48L2Rpdj4NCg== ----_com.android.email_2682303951971550-- 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 02:33:41 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3eebc4f314805235d5f44 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsLzD-0005mB-9Y for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:33:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsLzC-0000ap-IH for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:33:43 -0400 Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]:34273) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsLzC-0000af-B9 for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 22:33:42 -0400 Received: by lbbwb3 with SMTP id wb3so59125883lbb.1 for ; Fri, 30 Oct 2015 19:33:41 -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: John Kitchin Cc: "emacs-orgmode@gnu org" --001a11c3eebc4f314805235d5f44 Content-Type: text/plain; charset=UTF-8 Org-mode version 8.3.2 (8.3.2-10-g00dacd-elpa @ ../.emacs.d/elpa/org-20151005/) Did you all see my post directly before? The whole LOB idea seems not to work with Lisp/SLIME. . . --001a11c3eebc4f314805235d5f44 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Org-mode version 8.3.2 (8.3.2-10-g00dacd-elpa @ ../.emacs.= d/elpa/org-20151005/)

Did you all see my post directly before? The whole LOB idea seems n= ot to work with Lisp/SLIME. . .
--001a11c3eebc4f314805235d5f44-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas S. Dye Subject: Re: Babel: How to call code in one org file into another org file Date: Fri, 30 Oct 2015 17:08:12 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsMWr-000278-D9 for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 23:08:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsMWo-0008Rn-3t for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 23:08:29 -0400 Received: from gproxy5-pub.mail.unifiedlayer.com ([67.222.38.55]:57506) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZsMWn-0008RR-Sr for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 23:08:26 -0400 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 Aloha Lawrence, Lawrence Bottorff writes: > Doing M-x org-babel-lob-files called up a customization buffer that allowed > me to put in many separate file paths. I did this for ../a.org and ../b.org. > > a.org: > > #+name: myadd > #+begin_src lisp :session > (defun myadd (x y) > (+ x y)) > #+end_src > > b.org: > > #+name: multi_x2 > #+begin_src lisp :session > (defun multi_x2 (x) > (* 2 x)) > #+end_src > > then in c.org: > > #+name: add&multi_x2 > #+begin_src lisp :session > (defun add&multi_x2 (x y) > (multi_x2 (myadd x y))) > #+end_src > > but upon C-c C-c in c.org SLIME didn't know about myadd or multi_x2 ... > until I did C-c C-c in both a.org and b.org for the respective functions. > Then c.org's add&multi_x2 knew about the helper functions. That is > wonderful and allows a very distributed and modular approach to org-mode LP > for Lisp. However, it would be nice if I didn't have to acquaint my SLIME > session by hand all of my ingested babel-lob files. Any way to have this > happen automatically upon C-c C-c-ing my main org file? I found this > > discussion, > but I don't believe it really addresses my wish. I would use local variables for this--something like (untested): # eval: (org-babel-lob-ingest path/to/your/file) # eval: (sbe "my-add") # eval: (sbe "multi_x2") Computer savvy Org moders don't like eval because anything can happen, but if you're willing to trust yourself, then it shouldn't cause any problems. With this near the bottom of your file, whenever you open the file your other org files will be loaded into the Library of Babel where you can load up function definitions as needed. Of course, you'll need to have slime running when you open the file. hth, Tom -- Thomas S. Dye http://www.tsdye.com 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 03:58:30 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11401f0ea8fd0105235e8edf Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsNJI-00078v-RF for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 23:58:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsNJH-0002Uh-UN for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 23:58:32 -0400 Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]:33070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsNJH-0002Ud-Mh for emacs-orgmode@gnu.org; Fri, 30 Oct 2015 23:58:31 -0400 Received: by lfbf136 with SMTP id f136so29097674lfb.0 for ; Fri, 30 Oct 2015 20:58:30 -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: "Thomas S. Dye" Cc: emacs-orgmode Mailinglist --001a11401f0ea8fd0105235e8edf Content-Type: text/plain; charset=UTF-8 > > > I would use local variables for this--something like (untested): > > # eval: (org-babel-lob-ingest path/to/your/file) > # eval: (sbe "my-add") > # eval: (sbe "multi_x2") > > Computer savvy Org moders don't like eval because anything can happen, > but if you're willing to trust yourself, then it shouldn't cause any > problems. > > With this near the bottom of your file, whenever you open the file your > other org files will be loaded into the Library of Babel where you can > load up function definitions as needed. > > Of course, you'll need to have slime running when you open the file. > > hth, > Tom > Thanks Tom. Still, I'm wondering if the whole LOB is worth it in Lisp/SLIME-land. I can load code with org-babel-lob-ingest into `org-babel-library-of-babel`, but SLIME doesn't seem to know about it -- which sort of defeats the whole purpose, if you follow what I mean. . . . --001a11401f0ea8fd0105235e8edf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I would use local variables for th= is--something like (untested):

# eval: (org-babel-lob-ingest path/to/your/file)
# eval: (sbe "my-add")
# eval: (sbe "multi_x2")

Computer savvy Org moders don't like eval because anything can happen,<= br> but if you're willing to trust yourself, then it shouldn't cause an= y
problems.

With this near the bottom of your file, whenever you open the file your
other org files will be loaded into the Library of Babel where you can
load up function definitions as needed.

Of course, you'll need to have slime running when you open the file.

hth,
Tom

Thanks Tom. Still, I= 9;m wondering if the whole LOB is worth it in Lisp/SLIME-land. I can load c= ode with org-babel-lob-ingest into `org-babel-library-of-babel`, but SLIME = doesn't seem to know about it -- which sort of defeats the whole purpos= e, if you follow what I mean. . . .=C2=A0
--001a11401f0ea8fd0105235e8edf-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Babel: How to call code in one org file into another org file Date: Sat, 31 Oct 2015 10:57:17 +0100 Message-ID: <87y4ej2wea.fsf@gmx.us> 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]:33506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsSuq-0005zC-QT for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 05:57:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsSul-0003YO-G0 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 05:57:40 -0400 Received: from plane.gmane.org ([80.91.229.3]:35657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsSul-0003YH-9t for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 05:57:35 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZsSui-0007iM-23 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 10:57:32 +0100 Received: from 46.166.188.207 ([46.166.188.207]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 31 Oct 2015 10:57:32 +0100 Received: from rasmus by 46.166.188.207 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 31 Oct 2015 10:57:32 +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 Hi Lawrence, Lawrence Bottorff 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 > > file2.org: > ... > > #+begin_src lisp > (defun baa () > (foo)) > #+end_src At export time you could include a named block, but I’m not really sure that gets you closer to what you want. E.g. in file 1, #+name: fun_foo #+begin_src lisp (defun foo () (...)) #+end_src In file 2, #+include: "file1.org::fun_foo" #+begin_src lisp (defun baa () (foo)) #+end_src Rasmus -- Spil noget med Slayer! From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Babel: How to call code in one org file into another org file Date: Sat, 31 Oct 2015 11:41:48 -0400 Message-ID: <87oaff82pv.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]:36212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsYIE-0006Dr-An for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:42:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsYIA-00020q-Vv for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:42:10 -0400 Received: from plane.gmane.org ([80.91.229.3]:44265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsYIA-00020m-PF for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:42:06 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZsYI8-0001sm-N0 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 16:42:04 +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:42:04 +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:42:04 +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: > I would use local variables for this--something like (untested): > > # eval: (org-babel-lob-ingest path/to/your/file) > # eval: (sbe "my-add") > # eval: (sbe "multi_x2") > > Computer savvy Org moders don't like eval because anything can happen, > but if you're willing to trust yourself, then it shouldn't cause any > problems. > > With this near the bottom of your file, whenever you open the file your > other org files will be loaded into the Library of Babel where you can > load up function definitions as needed. > > Of course, you'll need to have slime running when you open the file. > > hth, > Tom > > Thanks Tom. Still, I'm wondering if the whole LOB is worth it in > Lisp/SLIME-land. I can load code with org-babel-lob-ingest into > `org-babel-library-of-babel`, but SLIME doesn't seem to know about it > -- which sort of defeats the whole purpose, if you follow what I > mean. . . .  > You got me all curious to see where things break: I had to install slime and clisp to find out. Everything is working I think: nothing is broken. As long as you are willing to add Tom's initialization (slightly modified - the function I have is org-sbe rather than sbe - I guess Tom has defined sbe in his own setup for backward-compatibility purposes), the following process works for me. Here's what I added to my .emacs: --8<---------------cut here---------------start------------->8--- (setq inferior-lisp-program "/usr/bin/clisp") ;;; start it - it's important to start slime *before* ;;; you load the c.org file below. (slime) (require 'ob-lisp) --8<---------------cut here---------------end--------------->8--- a.org and b.org are just as you defined them: --8<---------------cut here---------------start------------->8--- #+name: myadd #+begin_src lisp :session foo (defun myadd (x y) (+ x y)) #+end_src --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- #+name: multi_x2 #+begin_src lisp :session (defun multi_x2 (x) (* 2 x)) #+end_src --8<---------------cut here---------------end--------------->8--- and c.org with Tom's modifications looks like this: --8<---------------cut here---------------start------------->8--- #+name: add&multi_x2 #+begin_src lisp :session (defun add&multi_x2 (x y) (multi_x2 (myadd x y))) #+end_src #+BEGIN_SRC lisp :session (add&multi_x2 2 3) #+END_SRC # Local Variables: # eval: (org-babel-lob-ingest "./a.org") # eval: (org-babel-lob-ingest "./b.org") # eval: (org-sbe "myadd") # eval: (org-sbe "multi_x2") # End: --8<---------------cut here---------------end--------------->8--- Evaluation of the two code block in c.org proceeds correctly and without problems. -- Nick 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:17:55 +0000 Message-ID: References: <87oaff82pv.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c324b000646b052368e34f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsYqr-0000rj-PB for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:17:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsYqq-0001We-O7 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:17:57 -0400 Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:36251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsYqq-0001WU-Gz for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:17:56 -0400 Received: by lbjm5 with SMTP id m5so65346229lbj.3 for ; Sat, 31 Oct 2015 09:17:55 -0700 (PDT) In-Reply-To: <87oaff82pv.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: emacs-orgmode Mailinglist Cc: Nick Dokos --001a11c324b000646b052368e34f Content-Type: text/plain; charset=UTF-8 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. 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. --001a11c324b000646b052368e34f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable --001a11c324b000646b052368e34f-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Babel: How to call code in one org file into another org file Date: Sat, 31 Oct 2015 12:34:04 -0400 Message-ID: <87bnbf80ar.fsf@pierrot.dokosmarshall.org> References: <87oaff82pv.fsf@pierrot.dokosmarshall.org> 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]:46717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsZ6i-0004AT-43 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:34:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsZ6e-0005du-U4 for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:34:20 -0400 Received: from plane.gmane.org ([80.91.229.3]:45881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsZ6e-0005dq-Nm for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 12:34:16 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZsZ6d-00064I-Cn for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 17:34:15 +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 17:34:15 +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 17:34:15 +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: > 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 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-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Babel: How to call code in one org file into another org file Date: Mon, 2 Nov 2015 07:09:53 +0000 Message-ID: <87fv0ozxku.fsf@delle7240.chemeng.ucl.ac.uk> References: <87oaff82pv.fsf@pierrot.dokosmarshall.org> <87bnbf80ar.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zt9uV-0005xz-J3 for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 02:52:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zt9uQ-0002y5-KD for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 02:52:11 -0500 Received: from mail-am1on0137.outbound.protection.outlook.com ([157.56.112.137]:24862 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zt9uQ-0002ws-C2 for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 02:52:06 -0500 In-Reply-To: (Lawrence Bottorff's message of "Sat, 31 Oct 2015 16:51:07 +0000") 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: Nick Dokos , emacs-orgmode Mailinglist On Saturday, 31 Oct 2015 at 16:51, Lawrence Bottorff wrote: > 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. But it does. There are two levels here: the babel codes and the results of the codes. If your babel codes are emacs which define functions, these latter functions are not available until the babel codes are executed. However, the babel codes are now there and ready to be executed by name. I would not want ingest to execute the codes for two reasons: many of the codes do not make sense without special arguments and there may be many such codes. -- : Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.2-215-gb4af3f From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Babel: How to call code in one org file into another org file Date: Mon, 02 Nov 2015 08:36:54 -0500 Message-ID: <87ziyw7cax.fsf@pierrot.dokosmarshall.org> References: <87oaff82pv.fsf@pierrot.dokosmarshall.org> <87bnbf80ar.fsf@pierrot.dokosmarshall.org> <87fv0ozxku.fsf@delle7240.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtFIK-0007ug-DY for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 08:37:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtFIF-0005rn-Cz for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 08:37:08 -0500 Received: from plane.gmane.org ([80.91.229.3]:52562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtFIF-0005qx-6l for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 08:37:03 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZtFID-0003Eu-Od for emacs-orgmode@gnu.org; Mon, 02 Nov 2015 14:37:01 +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 ; Mon, 02 Nov 2015 14:37:01 +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 ; Mon, 02 Nov 2015 14:37:01 +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 Eric S Fraga writes: > On Saturday, 31 Oct 2015 at 16:51, Lawrence Bottorff wrote: >> 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. > > But it does. There are two levels here: the babel codes and the results > of the codes. If your babel codes are emacs which define functions, > these latter functions are not available until the babel codes are > executed. However, the babel codes are now there and ready to be > executed by name. > > I would not want ingest to execute the codes for two reasons: many of > the codes do not make sense without special arguments and there may be > many such codes. Indeed - and just to amplify this a bit, you can arrange (and it's arguably "better" if you have files whose code blocks you want to reuse) for all the relevant files to be in org-babel-library-of-babel during initialization; you do not *need* to have them added through the Local Variables trick: just add org-babel-lob-ingest calls to .emacs. You can also add the block evaluations in your .emacs, but that is probably a bad idea as Eric points out. Instead, use Local Variables with eval: (org-sbe "foo") calls to evaluate just what you need for the current buffer (and make sure that the relevant inferior process running the language interpreter is started *before* you open the file: emacs-lisp is exempt, since it's always there). The difference of opinion arises in the interpretation of "ready and available". The LOB in this case (and maybe in all cases, but I haven't used it often enough to be able to make such a statement) behaves more like an #include file in C, rather than a library of precompiled code that you link against (think libc.so or equivalent): you need to "compile" (i.e. evaluate) the code block before it becomes available to your code. -- Nick