Commit graph

1421 commits

Author SHA1 Message Date
Sam Steingold
387d067558 make C-c C-x a prefix key 2018-11-04 15:07:29 -05:00
John Miller
85d80f4394 Merge branch 'fix-oinfo-errors' 2018-11-02 16:16:39 -05:00
John Miller
134b77c3be ein-pytools: Setuphook for add sys path no longer needed.
Since we inject the pytools python code directly into the kernel we no longer
need to hack on the python system path.
2018-11-02 15:57:10 -05:00
dickmao
5023b0796b Reconnect is not restart #377
Upon disconnection, the jupyter server apparently returns the same kernel for a given
notebook path input.  So reconnect is a thing, and restart is very
distinct from that.

Fixes #377
2018-11-02 11:32:12 -04:00
John Miller
dd8a1607cd ein-pytools: Make pytools work over remote connections.
Python running on a remote connection doesn't know how to find files on the
local machine, apparently, so we take the route instead of sending the contents
of a temporary buffer loaded with the pytools python code to the running kernel.
2018-11-02 06:32:10 -05:00
dickmao
d19f696e59 add latex hotkey. need to apply rendering per ewoc lest emacs starts killing buffers 2018-11-01 22:07:05 -04:00
John Miller
78994fbe58 Always return an info object, don't always log a completer error.
I am expecting that `ein:completions--prepare-oinfo' will error out depending on
the type of python object we are looking at, so no need to log an error every
time this happens as it will unnecessarily fill the ein log buffer and generate
lots of annoying notifications in the notebook buffer.
2018-11-01 20:59:23 -05:00
John Miller
3df0552104 Get rid of log messages, fix some ein.py blunders.
*ein:log-all* will grow very quickly if we keep these log commands in.
2018-11-01 20:29:13 -05:00
John Miller
db310073c4 Robustly build oinfo cache.
EIN tries to build a cached of pdef's for all potential completion symbols. This
is problematic because not all completion symbols have a pdef and can cause
python to throw exceptions in entertaining and hard to catch ways. We take a
liberal approach and ignore anything that throws an exception when we try to
inspect it.

Eldoc support should also be more robust because of these changes as well.
2018-11-01 20:26:42 -05:00
John Miller
6e7d3dd158 ein-pytools: Don't request tooltips for magic functions.
Someone wants ein to get tooltip information for magic functions - we don't
currently support this so will skip these situations.
2018-11-01 20:13:45 -05:00
John Miller
c1a8d2c720 ein-notebook: Make eldoc an optional feature.
So I and others can do testing while the less intrepid can continue with things
the way they were.
2018-11-01 20:13:45 -05:00
dickmao
db2856f445 Restart if kernel still alive needs to work 2018-11-01 20:08:10 -04:00
dickmao
d621944797 Clean up websocket callbacks
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.
2018-10-31 23:38:45 -04:00
dickmao
35ccc3de34 Bug #369
6d42e0e771/lisp/ein-notebook.el (L419)
2018-10-31 03:51:50 -04:00
dickmao
c9be1f1120 a quick hack to fix #239 (coursera) that ignores the url-retrieve way
of doing things
2018-10-29 02:00:57 -04:00
dickmao
80839a1d77 finish previous commit 2018-10-28 14:38:53 -04:00
dickmao
aaeffa4596 end deferred chain on bad login 2018-10-28 13:48:53 -04:00
dickmao
b950bd3a4c Fix "Kernel is busy..." bug
One line change to fix header not updating after cell execution
(keeps saying "Kernel is busy").

The bug does not manifest when running with `ein:debug` true since
EMACS's display loop updates more frequently with debug messages.

In tracking this bug, noticed eldoc support isn't quite there.
`__import__('ein').print_object_info_for(%s)` appears in
`ein-completer` and `ein-pytools`, and is invalid python syntax
afaict.  Took a few steps to make it whole, but incomplete.
2018-10-27 23:04:04 -04:00
John Miller
e1b26550b2 ein-dev: Don't try to require ein-autoloads.el
Fix is mostly so we can continue to build the documentation.
2018-10-26 21:20:44 -05:00
dickmao
0490031ec8 Sane File Navigation
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).
2018-10-26 18:40:19 -04:00
dickmao
2aa5d004b4 fix a spoonerism 2018-10-26 12:20:07 -04:00
John Miller
ab8f881bff ein-notebooklist: Fix check for multiple servers on same port.
If `notebook list` returns more than one entry for the same url:port the
resulting structure won't be a list of lists, but rather a list of multiple
paired elements.
2018-10-23 09:02:17 -05:00
dickmao
e693a53e5a master fixes
ein:url normalization issue (fails the passworded server test).
"No servers running here" warning is unsettling for I think the
majority of users who do not run jupyter locally.
2018-10-23 02:12:45 -04:00
John Miller
309e21c119 Merge branch 'master' of ssh://github.com/millejoh/emacs-ipython-notebook 2018-10-22 18:15:05 -05:00
John Miller
21dca7b2f9 Merge branch 'login-staging' 2018-10-22 14:54:20 -05:00
John Miller
6944fb0a3f ein-notebooklist: Fix format string.
Format string was missing a parameter. Also some doc string cleanup.
2018-10-22 14:52:46 -05:00
John Miller
a26ca7fa7d ein-notebooklist: Fix corner case in token autodetection.
There appears to be a (hopefully very rare) possibility of `jupyter notebook
list --json` returning multiple tokens for the same url. This will result in
some perplexing behavior in ein, so these changes try to bring clarity when such
a situation occurs.
2018-10-22 14:49:45 -05:00
John Miller
35f06babc6 ein-worksheet: Fix whitespace, argument list for error call.
Missing an argument for the error format string. Also cleaned up some lingering
whitespace.
2018-10-22 14:45:14 -05:00
dickmao
3ba5548208 Issue #355 - remove an endless loop
Remove a waiting for godot loop in `ob-ein`.
Add a test stub for ob-ein.
2018-10-21 14:44:11 -04:00
dickmao
16cb32a1a6 more request-curl callback protections 2018-10-20 21:37:47 -04:00
dickmao
7a6d3c072b appveyor for msys2 2018-10-20 20:19:58 -04:00
dickmao
0345ed0b33 Try to address windows NT unseen. Add osx. Add ipython 7.0.1. 2018-10-20 00:12:34 -04:00
John Miller
ad978aad11 ob-ein: Save source block contents before executing.
Fixes #358.
2018-10-19 13:41:13 -05:00
dickmao
461b268eea retry kernelspecs 403 2018-10-18 19:05:17 -04:00
dickmao
c89a0a8887 it a'int easy being green. 2018-10-18 16:23:49 -04:00
John Miller
3fd5fd06ee ein-websocket: Don't dump entire websocket structure during error.
Dumping the whole structure to the log does more to obscure than help, so I have
shortened the amount of information shared.
2018-10-17 20:59:58 -05:00
dickmao
6e3a062e98 travis is a harsh taskmaster 2018-10-17 17:45:19 -04:00
dickmao
c5bfb0dca1 expose ein:notebooklist-open as a bonafide function (but obsolete) 2018-10-17 17:24:34 -04:00
dickmao
085a188b20 Streamline login
Merge the login and open commands (open aliased to login).  Add login
tests described in #352.

Attempt to improve user experience by synchronously executing
`ein:jupyter-server-start`.  `ein:dev-prefer-deferred` custom variable
allows easy switch to compare sychronous versus old asynchronous behavior.
2018-10-17 16:52:10 -04:00
John Miller
81ea6b25fa ob-ein.el: Fix for starting sessions from an org buffer.
John has now achieved zen understanding of the difference between `funcall' and
`apply'.
2018-10-16 16:05:06 -05:00
dickmao
3ba6622005 Revert "Normalize url-or-port"
This reverts commit 435d001b03.
2018-10-15 16:23:10 -05:00
dickmao
9c1271b8d9
Merge branch 'master' into issue-350 2018-10-15 12:32:28 -04:00
John Miller
2c2e1940d0 Merge branch 'master' of ssh://github.com/millejoh/emacs-ipython-notebook 2018-10-15 11:19:44 -05:00
dickmao
512658883b @sam-s says Requiring ESS is wrong because it forces people who do NOT use it to install it.
The standard way to avoid this problem is to use autoload instead of require.
This way ESS is not required to compile and run EIN and it is only loaded if the user actually uses it.
2018-10-15 12:19:30 -04:00
John Miller
d40e8b6d32 Quick fix for #350
There may be a better way to do this, but for now at least ein will load even if
the user does not have ess installed.
2018-10-15 11:13:37 -05:00
John Miller
032c6f4d8c ob-ein: Make session url's consistent.
Ensure canonical representation defined in `ein:url' is being used for session
identifiers. Not doing this was confusing ob-ein on what kernelspec to use.
2018-10-15 11:04:55 -05:00
John Miller
fd91a6f3e1
Merge pull request #352 from dickmao/bug-issue-351
Fixes #351
2018-10-15 09:41:53 -05:00
John Miller
ad86e606ca
Merge pull request #349 from xor-xor/bugfix/pytools-export-buffer
Fix ein:pytools-export-buffer
2018-10-15 09:31:12 -05:00
dickmao
cea40017fa fix bug 2018-10-15 10:29:11 -04:00
dickmao
435d001b03 Normalize url-or-port
```
"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.
2018-10-14 20:36:49 -05:00