Ihor Radchenko writes: [...] > Thanks! > The second patch is malformed. May you please resend? Sorry, resend with rewritten test. [...] > If you can, please avoid using `org-test-at-id'. This is much less > readable compared to explicit org-test-with-temp-text because one needs > to reach out to another file in order to understand what the test is > about. Now it's less verbose, handles both cases (with and without TARGET-FILE) and prints detailed ert explanation. > Evgenii Klimov writes: [...] >> It wasn't clear for me: will ":tangle yes" or explicit ":tangle no" be >> affected by TARGET-FILE. Maybe if we rephrase as follows it will be >> clear for both of us: >> >> Optional argument TARGET-FILE can be used to overwrite a default >> export file in `org-babel-default-header-args' for all source >> blocks. > > In `org-babel-tangle', TARGET-FILE is set as fallback value for the > blocks that have no :tangle value at all, including inherited; including > :tangle yes. This exactly idea I wanted to add to the docstring. > The manual asserts > > ‘yes’ > Export the code block to source file. The file name for the source > file is derived from the name of the Org file, and the file > extension is derived from the source code language identifier. > Example: ‘:tangle yes’. > > So, "yes" should imply :tangle > > `org-babel-tangle-collect-blocks' handles this by > > (unless (or (string= src-tfile "no") > (and tangle-file (not (equal tangle-file src-tfile))) > (and lang-re (not (string-match-p lang-re src-lang)))) > > So, :tangle no is always excluded. > When TANGLE-FILE is set and not equal to :tangle value (including > "yes"), block is also excluded. Indeed, but later ‘no’ The *default*. Do not extract the code in a source code file. Example: ‘:tangle no’. in conjunction with TARGET-FILE's description in ~org-babel-tangle~ docstring: Optional argument TARGET-FILE can be used to specify a *default* export file for all source blocks. made me feel doubt about TARGET-FILE's effect. Anyway, probably it was my incorrect interpretation, so let's leave it as it is.