Skip to content

Commit

Permalink
Make the jupyter executable configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
mpereira authored and nnicandro committed Nov 26, 2023
1 parent 17d074e commit 547bf7d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion jupyter-env.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ directory is where kernel connection files are written to.
This variable should not be used. To obtain the runtime directory
call the function `jupyter-runtime-directory'.")

(defcustom jupyter-executable "jupyter"
"The `jupyter` command executable."
:type 'string
:group 'jupyter)

(defun jupyter-command (&rest args)
"Run a Jupyter shell command synchronously, return its output.
The shell command run is
Expand All @@ -49,7 +54,12 @@ return nil."
(let ((stderr-file (make-temp-file "jupyter"))
(stdout (get-buffer-create " *jupyter-command-stdout*")))
(unwind-protect
(let* ((status (apply #'process-file "jupyter" nil (list stdout stderr-file) nil args))
(let* ((status (apply #'process-file
jupyter-executable
nil
(list stdout stderr-file)
nil
args))
(buffer (find-file-noselect stderr-file)))
(unwind-protect
(with-current-buffer buffer
Expand Down

0 comments on commit 547bf7d

Please sign in to comment.