Andrea <andrea-...@hotmail.com> writes: > .... > Sometimes I get an error on org-babel-load-file saying that > org-babel-tangle-collect-blocks was called with target-file set to nil.
May it be possible to provide more details about the error you are seeing? You can set `debug-on-error' to t and post the backtrace, which will give more details. Or, better, provide a reproducer. See https://orgmode.org/manual/Feedback.html#Feedback > Since that seems an effective but senseless action, I just looked into it and > there is > something weird in the code of org-babel-tangle: > > Given the header of the function: > > (defun org-babel-tangle (&optional arg target-file lang-re) > > and the docstring section > > "Optional argument TARGET-FILE can be used to specify a default export > file for all source blocks. " > > I think this let binding in org-babel-tangle is weird and the cause of my > error: > > (tangle-file > (when (equal arg '(16)) > (or (cdr (assq :tangle (nth 2 (org-babel-get-src-block-info > 'no-eval)))) > (user-error "Point is not in a source code block")))) > > Shouldn't that be: > > (tangle-file > (or > (when (equal arg '(16)) > (or (cdr (assq :tangle (nth 2 (org-babel-get-src-block-info > 'no-eval)))) > (user-error "Point is not in a source code > block"))) > target-file ;; the target file which was passed as input of > org-babel-tangle > )) No, tangle-file being nil should not be a problem. > Any chance I found a bug? Likely, but not necessarily in `org-babel-tangle'. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>