M-x customize-group RET ein
Toggle Ein:Polymode
Avoid trying to emulate jump-to-definition, eldoc, and autocompletion
functionalities that Elpy will always do better.
Fixes#497#482#418
Say `Contents API 5.7.4` instead of `Notebook v5` in notebooklist.
EIN doesn't care about the python version (2.7, 3.5) or the
ipython version (5.8.0, 6.2.1). The "jupyter notebook contents api"
version (currently at 5.7.4) is the thing that matters.
Coursera appears to kill websockets every minute or so, and I'm
observing firsthand the buggy behaviors described in #356. This PR
cleans up the websocket code and kernel restart logic. Removed
backwards compatibility for the v2 messaging api
as keeping it in the presence of the refactoring would make it more
broken that it already was.
As emacs users we prefer and have the luxury of fuzzy file navigation
via ido and projectile. From a notebook or notebooklist buffer, the commands
`C-c C-f` ein:file-open
`C-c C-o` ein:notebook-open
offer an ido alternative to point and click navigation.
To populate the ido lists, retrieving the content hierarchy is on by
default. Two custom variables determine how wide and deep the content query
probes (currently at 2 levels deep and 6 directories wide). Set both
to zero to turn off.
tkf half finished code to quickly go from local file buffers to notebook
mode via `C-c C-z` or `C-c C-o`. This is now possible. EIN will
start the server from a suitable parent directory of the visited file.
Enable ido completion for `notebooklist-login`.
Remove the albatross `ein-loaddefs.el` in favor of more standard
`ein-autoloads.el` that is not git tracked.
Convenience `make install` from git source (local alternative to
melpa).
```
"http://localhost:8888"
"http://localhost:8888/"
"http://127.0.0.1:8888"
"http://127.0.0.1:8888/"
"8888"
8888
```
Ideally these should converge to the same thing. Since many hash
tables are keyed off `url-or-port`, forgetting to
normalize `url-or-port` with `ein:url` leads to missed cache hits and
general malaise. So we try to do that.
Address a FIXME: apply callbacks to `ein:notebook-list-login-and-open`.
Removed py3.5 from travis build matrix to reduce developer strain.
Use deferred and callbacks instead of `:sync t` for tkf requests which
is known to have issues. Query server attributes once on
notebooklist-open to avoid sequencing issue #176 (but allow Resync).
Under curl backend, a second request for the same "key" as a pending
request will abort the latter, which has resulted in a clobbered
curl-cookie-jar file, so merely warn and don't abort.
Fix#176
Loading large notebooks (>1M) can be slow. At least some of this is due to
downloading from the jupyter server, but this operation is asynchronous and
should not block emacs. My suspicion is that when Emacs blocks it is when it is
generating the internal data structures used to represent the notebook in emacs.
This is somewhat unavoidable, but part of the slow down may be due to reaching
the cons threshold. These changes try to temporarily increase the cons threshold
while loading the notebook. We'll see if it helps at all.
`ein:jupyterhub-connect' will take a url for the jupyterhub server, a user, and
a password and then get and store the authorization token for that user.
Big things on the way!
It seems there are enough people out there still on Emacs 24 to warrant undoing
some of my recent moves away from eieio to cl-generic. For the near future I
will try to keep any changes that are incompatible with Emacs 24 to a
development branch. There is still probably plenty of opportunity to make the
code more future-proof for an eventual move away from eieio (I'm looking at you
oref and sref...)
EIN now lists other file types in notebooklist buffer and will allow user to
open those files for editing. The new buffer will get the right major-mode most
of the time, but has a hard time getting the line coding right on Windows
platform.
Login and notebooklist requests have a tendency to fail with the curl request
backend when there is no cookie jar file. Request will create the cookiejar, but
apparently with the asynchronous nature of ein this happens too slowly causing
content REST queries to fail. My tactic here is to repeat the call once, and
only once when a failure is detected. It is a difficult problem to reliably
create so I'm not sure if this is a good fix or not. Time will tell.
Automatically calling ein:notebooklist-login when a content API calls is a BAD
IDEA. Much better to warn and suggest, and if debugging is enabled throw the
error so hopefully a backtrace can be generated.
Taking some initial steps away from eieio and towards cl-generic.
Content api tries to handle redirects, pointing new content towards the
redirected url instead of the one supplied by the user. Login with redirects not
working, though.
Other fixes:
- Fixed bug in ein-ac that was generating errors outside of ein buffers.
- New function `ein:pyools-set-figure-size` as shortcut for modifying
matplotlib figsize rcParam.
- ob-ein will output tracebacks when ein source block generates an error.
tkf/emacs-request#60 was recently fixed, so no longer need to defadvice
`request--netscape-cookie-parse. Changed names of some obsolete variables. Also
trying to be a bit more clever in error handling by judicious use of
condition-case.
Notebooklist was not showing kernel status anymore.
Connect_request messages are deprecated since v5.0 of the messaging
spec, and ein never did much anyway with the message.
EIN can communicate with the jupyter contents API synchronously or
asyncronously, with the default behavior the latter. For a time it has
been possible to force synchronous from the code, but now I have made
that a user-configurable parameter (see `ein:force-sync`).
Newly created notebooks no longer error on saving - bug in how
kernelspec metadata was being filled in.
Also a number of miscellaneous fixes to indentation that have
inexplicably appeared in the code.
Some small fixes for typos and catching up on version info.
Code wasn't calling `ein:notebook-save-notebook-error` when content
saving failed. Small detail, but would result in "Notebook saving"
eternally hanging out in notebook message display.