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