emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [FR] Make :var foo=name-of-src-block assign the source block code in


From: Sébastien Miquel
Subject: Re: [FR] Make :var foo=name-of-src-block assign the source block code instead of currently assigned result of evaluation (was: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments)
Date: Sun, 17 Jul 2022 17:39:53 +0000


Hi,

Ihor Radchenko writes:
> Hmm. You are right. I missed "optionally".
>
> Still, I find this idea as the best solution for people who want to
> process the source block text during noweb expansion.
>
> Alternative ideas are welcome though. I'd prefer to avoid breaking
> change if we can find an equally simple syntax alternative to assign
> source block code to a variable.

The uses are maybe too niche to warrant the breaking change. A syntax
extension like
 : var=block-id[]
seems possible, even though brackets are already overloaded.

One alternative is to only allow the syntax inside noweb brackets
instead of generic variable arguments. I assume there'd be much less
breakage. It would also makes sense to allow noweb references instead
of block ids. We'd add support for
 : <<babel-fn(var=noweb-ref)>>
and <<babel-fn(var=block-id)>> would also insert the contents as a
by-product.

Do you have any example of use in mind, beyond my original one ?

Regards,

--
Sébastien Miquel



reply via email to

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