Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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