From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: Babel: reusing language-specific functions Date: Thu, 9 Oct 2014 21:11:51 -0500 Message-ID: References: <87d2a4w199.fsf@iki.fi> <87zjd884j5.fsf@gmail.com> <878ukp24v0.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcPgP-0002g3-Cw for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 22:11:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcPgO-0006wn-Bj for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 22:11:53 -0400 Received: from mail-oi0-x22b.google.com ([2607:f8b0:4003:c06::22b]:48152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcPgO-0006wX-5D for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 22:11:52 -0400 Received: by mail-oi0-f43.google.com with SMTP id u20so5080436oif.2 for ; Thu, 09 Oct 2014 19:11:51 -0700 (PDT) In-Reply-To: <878ukp24v0.fsf@iki.fi> 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: Jarmo Hurri Cc: "emacs-orgmode@gnu.org" That is a great option when you want to run *without* a session. That is also a nice approach when you are using plantuml and do not want to use a single external file and include it all over the place. On Thu, Oct 9, 2014 at 12:23 AM, Jarmo Hurri wrote: > 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 > > --=20 Grant Rettke gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/ =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) =E2=80=9CLife has become immeasurably better since I have been forced to st= op taking it seriously.=E2=80=9D --Thompson