[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.
v4-0001-testing-lisp-test-ob-tangle.el-Test-block-collect.patch
Description: Text Data
v4-0002-ob-tangle.el-Avoid-relative-file-names-when-group.patch
Description: Text Data
- [BUG] ob-tangle.el: Blocks overwrite each other when grouping before tangling, Evgenii Klimov, 2023/07/12
- [PATCH] ob-tangle.el: Blocks overwrite each other when grouping before tangling, Evgenii Klimov, 2023/07/12
- [PATCH v2] ob-tangle.el: Blocks overwrite each other when grouping before tangling, Evgenii Klimov, 2023/07/13
- Re: [PATCH v2] ob-tangle.el: Blocks overwrite each other when grouping before tangling, Ihor Radchenko, 2023/07/14
- [PATCH v3] ob-tangle.el: Blocks overwrite each other when grouping before tangling, Evgenii Klimov, 2023/07/24
- Re: [PATCH v3] ob-tangle.el: Blocks overwrite each other when grouping before tangling, Ihor Radchenko, 2023/07/25
- [PATCH v4] ob-tangle.el: Blocks overwrite each other when grouping before tangling,
Evgenii Klimov <=
- Re: [PATCH v4] ob-tangle.el: Blocks overwrite each other when grouping before tangling, Ihor Radchenko, 2023/07/26
- [PATCH v5] ob-tangle.el: Blocks overwrite each other when grouping before tangling, Evgenii Klimov, 2023/07/26
- Re: [PATCH v5] ob-tangle.el: Blocks overwrite each other when grouping before tangling, Ihor Radchenko, 2023/07/28