reddit / emacs

org-babel-execute-src-block with `:results value` giving an error

CoolioDood · 2022-04-10 16:48
Let's say I create an Org document with the following contents: #+begin_src R :results value data <- data.frame(list(a=c(1,2), b=c(3,4))) data #+end_src I then type `C-c C-c` to run `org-babel-execute-src-block`, which reports the error "forward-sexp: Wrong type argument: markerp, nil". The debugger backtrace looks like this: Debugger entered--Lisp error: (wrong-type-argument markerp nil) #f(compiled-function () #<bytecode -0xadf27a319dde315>)() org-babel-insert-result(((1 3) (2 4)) ("replace" "value") ("R" "data <- data.frame(list(a=c(1,2), b=c(3,4)))\ndata" ((:colname-names) (:rowname-names) (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:exports . "code") (:session . "none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no")) "" nil 1 "(ref:%s)") nil "R") org-babel-execute-src-block(nil ("R" "data <- data.frame(list(a=c(1,2), b=c(3,4)))\ndata" ((:colname-names) (:rowname-names) (:result-params "value" "replace") (:result-type . value) (:results . "value replace") (:exports . "code") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none")) "" nil 1 "(ref:%s)")) org-ctrl-c-ctrl-c(nil) funcall-interactively(org-ctrl-c-ctrl-c nil) call-interactively(org-ctrl-c-ctrl-c nil nil) command-execute(org-ctrl-c-ctrl-c) Any ideas on what could be causing this error and/or how I can track it down? Fwiw, `:results output` works as intended.
[deleted] · 2022-04-11 10:43
[deleted]
CoolioDood · 2022-04-11 11:04
Solved it. `org-export-backends` has to include `org`. So like this: (custom-set-variables '(org-export-backends '(ascii html icalendar latex odt md org)))
JustinSilverman · 2022-10-11 20:59
Is this solution still working for you? I am running into the exact same issue but your solution did not solve my problem.
CoolioDood · 2022-10-12 09:55
Yes, it's still working for me. The only thing I've changed in the meantime (with respect to this issue) is that I moved the `custom-set-variables` call to a `:custom` block in `use-package`.
JustinSilverman · 2022-10-12 10:05
Hmmm I'll have to dig in more. Thanks!