From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarmo Hurri Subject: Re: Babel: reusing language-specific functions Date: Thu, 09 Oct 2014 08:23:47 +0300 Message-ID: <878ukp24v0.fsf@iki.fi> References: <87d2a4w199.fsf@iki.fi> <87zjd884j5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc6Cv-0005tp-En for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 01:24:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xc6Cq-0006Y6-8L for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 01:24:09 -0400 Received: from plane.gmane.org ([80.91.229.3]:40809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc6Cq-0006Y2-2p for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 01:24:04 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xc6Cm-0001Yd-4F for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 07:24:00 +0200 Received: from host-137-163-18-130.edu.hel.fi ([137.163.18.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Oct 2014 07:24:00 +0200 Received: from jarmo.hurri by host-137-163-18-130.edu.hel.fi with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Oct 2014 07:24:00 +0200 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 tsd@tsdye.com (Thomas S. Dye) writes: >> Jarmo Hurri writes: >>> I have a language-specific function - in this case Asymptote, but it >>> could be e.g. C as well - that I want to use in a number of different >>> source blocks of the same language in an Org file. How do I accomplish >>> this? > Or, perhaps use the noweb syntax. > > > #+NAME: foo > #+BEGIN_SRC emacs-lisp > (defun foo (x) (+ x 2)) > #+END_SRC > > #+results: foo > : foo > #+begin_src emacs-lisp :noweb yes > <> > (foo 3) > #+end_src > > #+results: > : 5 Yes, this is a perfect solution. You can use noweb to include any code block, not only function definitions. Thanks! Jarmo