Hello,

I, as everybody else, try to reuse code blocks. Therefore I collect the
code blocks in an org file, put names on them and be ready to go. Or so.
Imagine a code block that uses one of the reusable code blocks as a
means of post processing, like this:

#+begin_src latex :post hmw/cnv-svg2pdf(data="out/sparse_matrix")

If the file containing hmw/cnv-svg2pdf is in org-agenda-files everything
works. Both code blocks execute, their current working dir is that of
the file holding the latex block. Good. Maybe if there are different
implementations of hmw/cnv-svg2pdf in different files things become
complicated. But one can qualify the name of the code block with a file:

#+begin_src latex :post /funcs.org:hmw/cnv-svg2pdf(data="out/sparse_matrix")

But now the cwd changes and the latex block and hmw/cnv-svg2pdf have
different cwds. Things become confusing and break.

To me the first approach seems to be favourable. Maybe with the addition
that the named code blocks could be 'imported' into the current file in
a nice way (which isn't possible, is it?). I'm interested how you deal
with reusable code blocks, best practices, etc.

All the best
hmw

Reply via email to