Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use Emacs for literate programming.

I want my code to look like this .

<<class Hufftree definition>>=
template<typename DataType, typename Frequency> class Hufftree
  Hufftree public members
  Hufftree private members

In org-babel I can't give names to my code snippets which are spread all over the document and collect them together as shown below. Whenever I compile I want the tool to automatically insert <<member functions>> wherever I refer them.

Some text here. Blah blah...

<<my foo class>> ==
#+begin_src ruby 
class Foo{
    <<member functions>>

Something random to say about some other things. 

<<member functions>> ==
// code for member functions goes here 
share|improve this question
I might help if you include what you want to do in your question rather than just linking it. It would also help if you provide an example of what you want to achieve and include how far you have gotten in achieving that. – N.N. Nov 14 '12 at 6:41
It would also help if you describe what you didn't like about org-babel because AFAIK it's easiest way to do literate programming. – Daimrod Nov 14 '12 at 7:34

You might want to check out Noweb, which allows literate programming in almost any language with LaTeX or Sphinx/reStructuredText syntax; you can see an example here).

You could then use the standard Emacs LaTeX writing facilities and maybe mix with a multiple-major mode to edit the code portions.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.