New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restart and execute all #199

Open
anarcat opened this Issue Apr 14, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@anarcat

anarcat commented Apr 14, 2018

Hi!

There's a functionality from the web interface in Jupyter that I miss here: the Restart and Run All menu. Could we have the same thing in the EIN menus?

I wrote the following crappy lisp by cargo-culting stuff around:

(defun anarcat/ein:restart-execute-all (ws)
  "restart the kernel, wait for ready, then execute all cells"
  (interactive (list (ein:worksheet--get-ws-or-error)))
  (ein:notebook-restart-kernel-command)
  ;; wait for the kernel to *stop*
  (sit-for 1.0) ;; we should not need this.
  (let ((kernel (ein:get-kernel--worksheet))
        (timeout 3.0) ;; XXX: should be a parameter
        (tick-time 0.1))
    (loop repeat (floor (/ timeout tick-time))
          do (sit-for tick-time)
          until (ein:kernel-live-p kernel))
    (ein:worksheet-execute-all-cell ws)))

But I don't quite like it... isn't there something that can do this already?

By the way, I love this plugin. I've been struggling to work with Jupyter notebooks in the web interface: the project is great, but the editor drove me nuts, until I found this. So thanks. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment