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!