gregsexton / gregsexton/ob-ipython

"wrong type arguments: stringp sh"

Open
#203 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
742
Forks
107
PR merge metrics
No merged PRs in 30d

Description

I'm using ob-ipython-20180224.953, and I've seen this error ("wrong type arguments: stringp sh") while doing something completely unrelated to ipython. I've traced it, and it ends up in the following code:
```
(defun ob-ipython--configure-kernel (kernel-lang)
"Configure org mode to use specified kernel."
(let* ((kernel (car kernel-lang))
(language (cdr kernel-lang))
(jupyter-lang (concat "jupyter-" language))
(mode (intern (or (cdr (assoc language org-src-lang-modes))
(replace-regexp-in-string "[0-9]*" "" language))))
(header-args (intern (concat "org-babel-default-header-args:" jupyter-lang))))
...
```
It seems like most kernel names are like "Julia-0.6", and not directly found in `org-src-lang-modes`, thus their names are going through `(replace-regexp-in-string ...)` branch. But in my case I has kernel "bash", installed in my jupyter, and this kernel name is as-is present in `org-src-lang-modes`. And here is the catch: this map contains languages as _symbols_ not strings, but intern expect string, not symbol.

Personally, I've fixed it in my copy by just add `(symbol-name ..)` call around `(cdr (assoc language org-src-lang-modes))`. Probably, even better solution would be to move `(intern ..)` to be only around `(replace-regexp-in-string ...)`, since it is not needed in first branch.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.