reddit / emacs

org mode inline function call error

mahmooz · 2022-04-13 15:06
#+name: test #+begin_src python return "$x = 20$" #+end_src #+RESULTS: test : $x = 20$ * call_test() when i run `ctrl-c-ctrl-c` on `call_test()` i get `org-babel-insert-result: Wrong type argument: number-or-marker-p, nil` how do i fix this? thanks
ieure · 2022-04-13 15:16
A heading isn't a source block, so trying to evaluate it as one won't work. You could call it `* fish sandwich` and get the same results. See [Evaluating Code Blocks](https://orgmode.org/manual/Evaluating-Code-Blocks.html) from the Org Mode manual for the correct syntax to invoke a source block.
mahmooz · 2022-04-13 15:19
`call_test()` is an inline function call to the source block named `test` see [https://orgmode.org/manual/Evaluating-Code-Blocks.html](https://orgmode.org/manual/Evaluating-Code-Blocks.html)
ieure · 2022-04-13 15:22
That's very weird. I think you're probably not using that in the way it's intended. You should ask on the Org mailing list or open a ticket.
Careful_Assignment · 2022-04-13 15:35
This looks like a bug in org-mode. Add something in your "\* call\_test()" heading and it starts to work: ``` * call_test() {{{results(=$x = 20$=)}}} Something in heading... ```