doomemacs / doomemacs/core

Fix how `+org-eval-handler` handles `jupyter-eval-region`

Open
#6,571 0 comments 0 reactions 0 assignees View on GitHub
is:bug needs-triage
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### What did you expect to happen?

Use `+eval:region` to run code within "jupyter-*" source blocks. The code is sent to a jupyter repl and evaluated.

### What actually happened?

It gives the error

> Wrong type argument: "Not a valid client", nil, jupyter-current-client

### Describe your attempts to resolve the issue

Here is the fix:

Change ~/.emacs.d/modules/lang/org/autoload/org-babel.el:25

```emacs-lisp
(jupyter-eval-region beg end) ; remove this
(jupyter-org-with-src-block-client jupyter-eval-region beg end)) ; add this
```

This may also need some extra requires (`jupyter-org-client`, `ob-jupyter`) or autoloads. I'm not sure the best way to handle that.

### Steps to reproduce

1. Open org-mode buffer with "jupyter-*" source block
2. Put point in source block
3. Run `+eval:region`

### System Information

https://pastebin.com/DgDp1tSW

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.