emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v4] ob-tangle.el: Blocks overwrite each other when grouping befor


From: Evgenii Klimov
Subject: [PATCH v4] ob-tangle.el: Blocks overwrite each other when grouping before tangling
Date: Tue, 25 Jul 2023 17:12:46 +0100

Ihor Radchenko <yantar92@posteo.net> 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 <eugene.dev@lipklim.org> 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 file name.lang-ext>
>
> `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.

Attachment: v4-0001-testing-lisp-test-ob-tangle.el-Test-block-collect.patch
Description: Text Data

Attachment: v4-0002-ob-tangle.el-Avoid-relative-file-names-when-group.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]