From cf1d03598eb51ba9cc1591f774df5a35151577a8 Mon Sep 17 00:00:00 2001 From: Alexander Bernhofer Date: Thu, 9 Sep 2021 12:13:00 +0200 Subject: [PATCH] Use Jupyter shell command from given directory --- jupyter-env.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jupyter-env.el b/jupyter-env.el index 9b2547fe..1db476f5 100644 --- a/jupyter-env.el +++ b/jupyter-env.el @@ -38,16 +38,24 @@ 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'.") +(defvar jupyter-command-directory nil + "The directory of the Jupyter command. +If nil then use Jupyter command from the path environment variable. + +Used to run the `jupyter-command'.") + (defun jupyter-command (&rest args) "Run a Jupyter shell command synchronously, return its output. -The shell command run is +The shell command run is (in `jupyter-command-directory') jupyter ARGS... If the command fails or the jupyter shell command doesn't exist, return nil." (with-temp-buffer - (when (zerop (apply #'process-file "jupyter" nil t nil args)) + (when (zerop (apply #'process-file + (concat jupyter-command-directory "jupyter") + nil t nil args)) (string-trim-right (buffer-string))))) (defun jupyter-runtime-directory ()