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

Async evaluation broken for jupyter-julia Org blocks #58

Closed
dangirsh opened this issue Mar 12, 2019 · 2 comments
Closed

Async evaluation broken for jupyter-julia Org blocks #58

dangirsh opened this issue Mar 12, 2019 · 2 comments

Comments

@dangirsh
Copy link
Contributor

dangirsh commented Mar 12, 2019

I'm trying to run a block like this with a Julia 1.0.3 kernel on emacs-jupyter commit ea5ae74:

#+begin_src jupyter-julia :async yes
"Async" * "rocks"
#+end_src

I first hit this issue, so I set:

(add-hook 'ob-async-pre-execute-src-block-hook
          '(lambda ()
             (setq inferior-julia-program-name "/usr/local/bin/julia")))

Next, I hit a wrong-number-of-arguments error coming from the async process, which I manually traced to jupyter-repl-initialize-fontification. For some reason, the font-lock-defaults is nil in the child process's julia REPL buffer. This cascades to cl-destructuring-bind getting a nil argument, causing the error. Note, this doesn't happen for me with a Python 3 kernel.

I bypassed the fontification and re-executed the async request. Now I see the following:

Wrong type argument: jupyter-org-request, #s(jupyter-request "3bd5f75b-e8d4-4a7f-bdc7-040817931111" (23688 2124 987084 825000) nil nil nil nil)
Error running timer ‘jupyter-handle-message’: (error "Cell for request not found")

This also happens for the Python 3 kernel, making me suspect my setup (assuming it works for other people).

Aside: I'd also love to know how people debug async issues. I've been setting async-debug to get the transmitted sexp. I then manually run that sexp in a separate emacs process, which I launch like: emacs -Q -l /home/dan/.emacs.d/elpa/develop/async-20181224.454/async.el -f async-batch-invoke "<none>" (based on implementation of async-start).

@nnicandro
Copy link
Collaborator

nnicandro commented Mar 12, 2019

I think you might be running into #32, emacs-jupyter doesn't use the ob-async package for communication, but ob-async also handles the :async argument which seems to interfere with emacs-jupyter. The fix is to set ob-async-no-async-languages-alist to exclude emacs-jupyter. Should probably add a note about this in the README...

@dangirsh
Copy link
Contributor Author

Yup, fixed with:

(setq ob-async-no-async-languages-alist '("jupyter-julia" "jupyter-python"))

AWESOME

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

No branches or pull requests

2 participants