fix(org): don't export noweb-cache-related var

Org added a global cache for noweb expansion that includes a buffer
object. Those aren’t readable by the Lisp reader across processes, so
when async.el serializes the parent environment and hits that cons
`'(#<buffer *new*> . 739 )`, the child later tries to read it and errors
with `Invalid read syntax: "#<"'`

Fix: https://github.com/astahlman/ob-async/issues/99
This commit is contained in:
Samuel Tschiedel 2025-10-21 20:35:47 -03:00 committed by Henrik Lissner
parent ead254e152
commit bf62193238

View file

@ -217,6 +217,13 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
(after! ob
(add-to-list 'org-babel-default-lob-header-args '(:sync)))
(defadvice! +org--exclude-expand-noweb-references-a (fn &rest args)
:around #'ob-async-org-babel-execute-src-block
(let ((async-inject-variables-exclude-regexps
(cons "\\`org-babel-expand-noweb-references--cache-buffer\\'"
async-inject-variables-exclude-regexps)))
(apply fn args)))
(defadvice! +org-babel-disable-async-maybe-a (fn &optional orig-fn arg info params)
"Use ob-comint where supported, disable async altogether where it isn't.