emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicholas Patrick <npatrick04@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Org babel with multiple linked segments of source code
Date: Mon, 21 Mar 2011 21:57:30 -0500	[thread overview]
Message-ID: <AANLkTin_ymBo+nZm=NDAJp5b0__QTG0FqrV1r8Hnuq4N@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

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
<<test2>>
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 <<descriptive-name>>.
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?

[-- Attachment #2: Type: text/html, Size: 1166 bytes --]

             reply	other threads:[~2011-03-22  2:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22  2:57 Nicholas Patrick [this message]
2011-03-23  2:57 ` Org babel with multiple linked segments of source code Eric Schulte
2011-03-25 14:12   ` Nicholas Patrick
2011-03-29 14:09     ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTin_ymBo+nZm=NDAJp5b0__QTG0FqrV1r8Hnuq4N@mail.gmail.com' \
    --to=npatrick04@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).