Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
{
public:
  Hufftree public members
private:
  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>>
}
#+end_src

Something random to say about some other things. 

<<member functions>> ==
#+begin_src 
// code for member functions goes here 
#+end_src
share|improve this question
4  
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
1  
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

1 Answer 1

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

 
discard

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.