On 04/01/2026 9:32 pm, Ihor Radchenko wrote:
Max Nikulin writes:
From my point of view, a couple of helper functions with short names
and scope limited to templates may be considered, e.g. "%(var
default-directory)" and "%(svar 10)". The latter forces conversion to
string.
We cannot introduce such functions in Org. That would litter the global
function namespace. In theory, we can eval the %(...) templates
flet-binding these functions, but that is still against Elisp
conventions and may backfire if Emacs does introduce the name we use in
the future.
By "scope limited to templates" I meant something like flet. It seems,
it is more tricky for `eval' used by `org-capture-fill-template'.
So, if we want to add short versions of some functions, we should better
ask Emacs upstream.
I see you point and I have noticed your attempt to bump the thread on
python f-strings. I do not think that raw strings literals are related
to f- and t-strings. The latter may be implemented using macro. Format
protocol for various types may require cl-defgeneric. Raw string
literals require syntax extension. However in JavaScript template
literals are similar to raw string literals to some extent and tagged
templates is a part of the same feature
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates>