From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Org babel with multiple linked segments of source code Date: Tue, 22 Mar 2011 20:57:30 -0600 Message-ID: <87lj06a677.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=56264 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2EMc-0004QF-Tf for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 23:04:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2EMb-0004w2-TW for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 23:04:02 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:57610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2EMb-0004vw-P3 for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 23:04:01 -0400 Received: by pvg4 with SMTP id 4so1514592pvg.0 for ; Tue, 22 Mar 2011 20:04:01 -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: Nicholas Patrick Cc: emacs-orgmode@gnu.org Hi, The setup you suggest below is not currently supported. I fear implementing such a system could have some odd semantic extensions into other parts of Org-mode code blocks, for example, would it then make sense for the results of a code block to be collected over all code blocks with that name? For example, #+source: test2 #+begin_src emacs-lisp 1 #+end_src #+source: test2 #+begin_src emacs-lisp 2 #+end_src #+begin_src emacs-lisp :var data=test2 data #+end_src #+results: | 1 | 2 | Maybe, but this is certainly not possible under the current setup. Anyways, back to your use case, maybe it would be equally convenient to simply have a number of sequential code blocks in the Org-mode file all tangle out, as they will be placed in the tangled file in the order they appear in the Org-mode file, so your example below could be changed to... ** tangling example :PROPERTIES: :tangle: test1.clj :exports: none :END: #+begin_src clojure blah #+end_src #+begin_src clojure foo #+end_src #+begin_src clojure bar #+end_src #+begin_src clojure blah #+end_src While not the same as what you suggested this may be sufficient. Best -- Eric Nicholas Patrick writes: > 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?