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--