From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicholas Patrick Subject: Org babel with multiple linked segments of source code Date: Mon, 21 Mar 2011 21:57:30 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001636834014e45fd5049f096830 Return-path: Received: from [140.186.70.92] (port=34594 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1rn6-0000dn-4U for emacs-orgmode@gnu.org; Mon, 21 Mar 2011 22:57:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1rn5-0003v7-4N for emacs-orgmode@gnu.org; Mon, 21 Mar 2011 22:57:52 -0400 Received: from mail-qy0-f169.google.com ([209.85.216.169]:56689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1rn5-0003uz-1Z for emacs-orgmode@gnu.org; Mon, 21 Mar 2011 22:57:51 -0400 Received: by qyk2 with SMTP id 2so3179641qyk.0 for ; Mon, 21 Mar 2011 19:57:50 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001636834014e45fd5049f096830 Content-Type: text/plain; charset=ISO-8859-1 I'm trying to figure out how to minimize the overhead with using babel to write some segments of code. I find myself writing short segments of a set of functionality, then writing a collector source block which is referred to later on in the code... e.g. ********************* #+srcname: test1 #+begin_src clojure :tangle test1.clj :exports none :noweb yes blah <> blah #+end_src #+srcname: test2 #+begin_src clojure foo #+end_src #+srcname: test2 #+begin_src clojure bar #+end_src ********************* I'd like to see blah foo bar blah but I see blah foo blah What I'd like to see is a single srcname for the code that just concatenates the two different sections when it is referred by <>. That way I don't have to come up with different names and collectors and so on and so forth. Maybe I'm just not doing "literate programming" right, but when I'm hacking stuff together, I'd like to minimize the housekeeping. e.g. Is there a way to do this? --001636834014e45fd5049f096830 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm trying to figure out how to minimize the overhead with using babel = to write some segments of code.=A0 I find myself writing short segments of = a set of functionality, then writing a collector source block which is refe= rred to later on in the code... e.g.

*********************
#+srcname: test1
#+begin_src clojure :tangl= e test1.clj :exports none :noweb yes
blah
<<test2>>
bl= ah
#+end_src

#+srcname: test2
#+begin_src clojure
foo
#+end_src

#+srcname: test2
#+begin_src clojure
bar
#+end_sr= c
*********************
I'd like to see
blah
foo
bar
= blah

but I see
blah
foo
blah

What I'd like to se= e is a single srcname for the code that just concatenates the two different= sections when it is referred by <<descriptive-name>>.=A0 That = way I don't have to come up with different names and collectors and so = on and so forth.=A0 Maybe I'm just not doing "literate programming= " right, but when I'm hacking stuff together, I'd like to mini= mize the housekeeping.=A0 e.g.

Is there a way to do this?=A0
--001636834014e45fd5049f096830--