I want to use org-mode to compute long passages by concatenating snippets.
I'm open to a non-Babel approach. Tables occurred to me but I couldn't see how to reference a cell from outside the table in a way that imports the cell contents, not just links to it.
With Babel, I have text blocks that I reference via noweb in a final text block. I can't figure out how to make a text block emit something to #+RESULTS:
. There's no eval engine. I tried using elisp but newlines trip it up, and I can't M-q format the output otherwise, since the builtin functions are interactive. For text mode, I can tangle to an external file, but not inline.
Any ideas? I must be missing something. I can't imagine this is hard.
[EDIT]:
#+NAME: abc
#+BEGIN_SRC text
This is a string that is way too long to be on one line.
The point of this whole question is that blocks with hard paragraph
breaks don't work with the elisp noweb block.
#+END_SRC
#+NAME: def
#+BEGIN_SRC text
This is also a string that is way too long to be on one line.
Again, the point of this whole question is that blocks
with hard paragraph breaks don't work with the elisp
noweb block.
#+END_SRC
#+BEGIN_SRC elisp :noweb yes :results output
(princ "<<abc>>")
(princ "<<def>>")
#+END_SRC
When evaluating, I receive the message "End of file during parsing." When I tangle to an external file to inspect, what I see is this:
(princ "This is a string that is way too long to be on one line.
(princ "The point of this whole question is that blocks with hard paragraph
(princ "breaks don't work with the elisp noweb block.")
(princ "This is also a string that is way too long to be on one line.
(princ "Again, the point of this whole question is that blocks
(princ "with hard paragraph breaks don't work with the elisp
(princ "noweb block.")
Notice how the non-terminal lines in each text block don't get the double quote or closing parenthesis. This is obviously malformed elisp.
Again, I don't care how this is done. I just want to be able to compute long text passages that either line wrap well or preserve my hard-line-wraps.
It seems like neither org-mode tables nor org-mode babel can do this. I can't find an elisp function that does the equivalent of fill-paragraph
on a string, for example, into a list. That would solve this.