From 91ad6410bb3c6f699b8308ac1c73f282c4454496 Mon Sep 17 00:00:00 2001 From: Daniel Nicolai Date: Tue, 1 Jun 2021 17:02:45 +0200 Subject: [PATCH] Fix error due to call `intern` on symbol The cdr of the org-src-lang-modes elements is a symbol, giving it to intern as an argument causes an error. For me the error occured because I have the/a bash kernel installed. This change fixes it. --- ob-ipython.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ob-ipython.el b/ob-ipython.el index 043fb9a..2287c1b 100644 --- a/ob-ipython.el +++ b/ob-ipython.el @@ -533,8 +533,8 @@ The elements of the list have the form (\"kernel\" \"language\")." (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)))) + (mode (or (cdr (assoc language org-src-lang-modes)) + (intern (replace-regexp-in-string "[0-9]*" "" language)))) (header-args (intern (concat "org-babel-default-header-args:" jupyter-lang)))) (add-to-list 'org-src-lang-modes `(,jupyter-lang . ,mode)) ;; Only set defaults if the corresponding variable is nil or does not @@ -549,6 +549,7 @@ The elements of the list have the form (\"kernel\" \"language\")." 'org-babel-ipython-initiate-session) kernel-lang)) + (defun ob-ipython-auto-configure-kernels (&optional replace) "Auto-configure kernels for use with org-babel based on the available kernelspecs of the current jupyter installation. If