Christian Moe <[email protected]> writes:

> I'd guess that it's just a missing feature. Babel actually does find
> my-table, it just doesn't know how it's supposed to read a dynamic
> block. I think it's reasonable to expect named dynamic blocks to be
> supported as Babel references.
>
> I submit a patch with one way to solve it: Get org-babel-ref-resolve to
> check if we're at a dynamic block. If so, update it, then move one line
> forward and resolve the first element in the content of the dynamic
> block instead. Then the existing machinery of org-babel-ref-resolve and
> org-babel-read-element can handle it depending on whether it's a table,
> a paragraph with a time stamp, a list, or something else.

Note that a block may contain multiple elements.
Those elements may or may not be tables.

Let's think about it more generally.
What if we talk about something like drawer rather than dynamic block.
What would be the most sensible way to include drawer contents?

> A couple of what-could-possibly-go-wrongs I'm unsure about:
>
> - It seems like a good idea that Babel should update a dynamic block
>   before reading it, so I have made it so here. This will however change
>   contents elsewhere in the buffer while executing a src block, and with
>   remote references it may open a file and and leave the buffer open
>   with changed contents. Is this acceptable behavior? Or should it be
>   made optional, and what should be the default?

We have similar dilemma for src blocks. That dillema is solved by
src_name() vs src_name[] syntax.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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>

Reply via email to