Thanks Arne and Christian, Your suggestion of using =:noweb no-export= does work. For my use case (a literate c program where I don't use eval) it is a complete solution.
If I understand the code in ob-core.el correctly there is still an underlying issue. Basically, =org-babel-expand-noweb-references= has hardwired in it the assumption that we are in the eval context (the second patch in my initial message shows the location where eval is hardwired). Any of the noweb modes that are available in =:eval= context then lead to an expansion of noweb blocks. This includes =:noweb yes= and =:noweb no-export=. This is why your suggestion works. However, =:noweb tangle= does not work because it is not one of the allowed values in the eval context. It looks like =tangle= is the only case that is available in =:tangle= context but not in =:eval=. So perhaps this is not a very significant limitation. As I said, with your help I have a good solution for my use case. Let me know if you believe there is something that warrants fixing. I'll be glad to rework or improve the patches I sent or help in other ways. Thanks again. Cheers, Dominic On Sat, Sep 20, 2025 at 4:49 AM Christian Moe <[email protected]> wrote: > > "Dr. Arne Babenhauserheide" <[email protected]> writes: > > I’m not sure whether that’s a bug, but from your description, what you > > want might be achieved with :noweb no-export. Because I guess that you > > want noweb to work during execution. > > In my test, =:noweb no-export= did indeed work. But it seems reasonable > to expect that =:noweb tangle= should, too, so I'm inclined to think it > is a bug. > > Yours, > Christian
