Henrik Frisk <[email protected]> writes: > Hi, > > Here's what I would like to do: > > In a named source block (#+name:nameA) in File A I have a variable some code > defined > > In a source block in File B I want to run the source block in File A as if it > was definied in File B: > > #+begin_src emacs-lisp :noweb yes > <<nameA>> > #+end_src > > I realize that the simple solution is to tangle the files into one, but is > there a way to achive what I'm tryng to do?
You can add code from File A to your your "Library of Babel" with (org-babel-lob-ingest "/path/to/File-A.org") C-c C-x i Then you can reference the nameA block via noweb <<nameA>>, tangle it, use variable assignment :var=nameA, etc. Note that the nameA code is added to a list in the variable org-babel-library-of-babel and referenced from there, not from File A, so if you change the code, you will need to 'ingest' it again. Docs: - The manual: https://orgmode.org/manual/Library-of-Babel.html#Library-of-Babel - Worg: https://orgmode.org/worg/org-contrib/babel/intro.html#library-of-babel Regards, Christian
