Skip to content

Fix invalid read syntax error when result overlays are hidden#71

Open
spacebat wants to merge 2 commits intoastahlman:masterfrom
spacebat:master
Open

Fix invalid read syntax error when result overlays are hidden#71
spacebat wants to merge 2 commits intoastahlman:masterfrom
spacebat:master

Conversation

@spacebat
Copy link

Prevent org-babel-hide-result-overlays from being inherited by the async process, because overlays are not readable and lead to the following error:

if: Invalid read syntax: "#"

See commit message.

While running ob-async I kept getting this error:

  if: Invalid read syntax: "#"

When I enabled async-debug I found the culprit, overlays for babel
results that I had toggled to be hidden:

  ELISP> org-babel-hide-result-overlays
  (#<overlay from 13045 to 13045 in wat.org>)

This change excludes `org-babel-hide-result-overlays' specifically,
but a more general fix would test the value of each variable sent to
the subprocess to ensure it can be serialized.
@spacebat spacebat changed the title Fix invalid read syntax error Fix invalid read syntax error when result overlays are hidden Nov 12, 2020
@f4nyc
Copy link
Contributor

f4nyc commented Dec 22, 2020

Thanks for this pr which help me finding out the problem , "'error in process sentinel: async-handle-result: Invalid read syntax: "#"' . But I don't think hiding org-babel-hide-result-overlays is enough, because other variable may cause same phenomenon. Maybe we could wrap async-inject-variables to prevent passing buffer syntax i.e #<buffer scratch>, to closure ? Besides i wonder if it's valid to inject buffer object.

@malb
Copy link

malb commented Mar 6, 2021

Turns out setting ,(async-inject-variables "\\borg-babel.+" nil "^org-babel-jupyter") also fixes emacs-jupyter/jupyter/issues/294

@ErkiDerLoony
Copy link

Great catch, I was also struggling with this and failed to find a solution until I noticed this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants