I'm afraid I can't help much on this. I just used the org-babel-template.el file provided by Eric and did a search and replace as told in the file comments in order to make tangle work for octave and MATLAB. I didn't implement any function (I only know enough lisp to understand my own .emacs file). - Darlan