Passing "default" to `ein:get-kernelspec' would cause it to return a string
naming the actual kernelspec, which just won't do. So we look for that case and
then look for the real kernelspec.
Inspired by @khinsen's ob-ipython-async, automatically generate filenames for
inline images. That is, make :image an optional argument for ein source blocks
in org.
EIN historically used a call to python getcwd and gethostname to get information
about the currently running kernel. This won't work with non-python kernels, so
I this is an initial attempt to abstract out the call and make it language
agnostic. Still only works in Python, but at least should not cause errors with
other languages.
(ein:narrow-to-cell, ein:python-indent-line-function)
(ein:python-indent-region): New functions.
(ein:ml-lang-setup-python): Set
`indent-line-function` to `ein:python-indent-line-function` and
`indent-region-function` to `ein:python-indent-region`.
Full undo support, including undoing cell actions, is still unstable and can
cause corruption of worksheet data so I am making this an optional feature. See
the variable `ein:worksheet-enable-undo', which by default will be set to nil.
Force a query of available kernelspecs when calling `ein:notebooklist-open'.
Idea is to catch when user installs a new kernelspecs while ein is active.
No default keybinding, but one can now call `ein:tb-show' from an org
buffer using ein source code blocks when one of the blocks generates a
traceback.
EIN should properly handle indentation in the worksheet as it once did long ago.
Issues was that python mode no longer uses the global variables
`python-ident-levels' for tracking ident. Now we advise around
`python-indent--calculate-indentation'. This is an internal function so may not
be the best call, but it works.
If it breaks maybe take a look at advising `python-ident-calculate-indentation'.
Instead of always prompting the user for the path to the jupyter
executable, it will try to use the value of `*ein:last-jupyter-command*' or
the value of the customizable variable `ein:jupyter-default-server-command'
when the `ein:jupyter-server-start` command is called without C-u prefix arg.
As well as going to a non-deferred implementation for
`ein:notebooklist-change-url-port' the code now properly restarts the nb kernel
when changing the server the notebook is running on.
Also a small change to the formatting of the notebooklist buffer.
Not at all sure why, but succesfully starting jupyter and detecting login token
info is sensitive to this factor. On Windows, a call to accept-process-output
prior to the deferred chain also works, but unfortunately seems to cause issues
on some Linux installations.
For the moment a factor of 10 seems to work, but we will see what feedback from
the community is. This may need to be a customizable variable.
Optional argument PROCESS means do not return until output has been
received from PROCESS.
If jupyter notebook is fast enough and made all the outputs, at the
time of invoking accept-process-output will block until timeout.
Revert "ein-jupyter: Try waiting for process output before logging in."
This reverts commit 9cae1ba153.
Don't think we were handling https:// url's correctly.
Also some code cleanup in ein-connect; fix longstanding bug in ein:load-files,
and tweak default timeout for starting a jupyter session from within emacs.