Hi Max, thank you for the answer.

I have abandoned the idea 😀. Yes, org-mks is the one that does the lifting, you can see my other answers to Ihor., where I am playing with an example "usage pattern", that uses org-select-template which uses org-mks underto achieve a similar goal as you present here.

Sorry for a bad formatting, I am typing this from my phone. 


-------- Originalmeddelande --------
Från: Max Nikulin <manikulin@gmail.com>
Datum: 2022-05-31 18:37 (GMT+01:00)
Till: Arthur Miller <arthur.miller@live.com>
Kopia: emacs-orgmode@gnu.org
Ämne: Re: Proposal: 'executable' org-capture-templaes

On 30/05/2022 09:04, Arthur Miller wrote:
> Ihor Radchenko writes:
>> Arthur Miller writes:
>>
>>> Simplicity comes from the org-templates. Me, and I guess other people are
>>> familiar with org-catpure templates already, and I mean, can it be simpler to
>>> create a menu of choices then a simple list:
>>>
>>> '(("key1" "label1" exec (lambda () ...))
>>>    ("key2" "label2" exec (labmda () ...))
>>>     ...
>>>     )
>
> I am not really familiar with those other dialogues but org-capture, so I only
> had that one in the mind.

There is `org-insert-structure-template' C-c C-,

Doesn't the following code do what you are asking for?

(let ((entry (org-mks `(("a" "A entry" ,#'identity)
                       ("b" "B entry" ,(lambda (x) (* 2 x))))
                     "A or B")))
   (funcall (nth 2 entry) 10))