Commit graph

1261 commits

Author SHA1 Message Date
John Miller
3c84bc2ff5 Fix for #347. 2018-10-12 10:34:04 -05:00
dickmao
3f1d9f3737 ein:flatten runs out of stack on big directories; also don't wait on files 2018-10-07 03:15:49 -04:00
dickmao
11c2245c41 Asynchronize all server communication
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
2018-10-07 00:40:48 -04:00
dickmao
ad8408dfb7 Implement undo
`M-x customize-group RET ein`
Toggle `Ein:Worksheet Enable Undo`
Save for Future Sessions
Restart emacs or kill/restart notebook

Fixes #338
2018-10-02 10:00:25 -04:00
John Miller
0793b689e9 Merge remote-tracking branch 'dickmao/revive-unit-tests' 2018-09-28 12:08:10 -05:00
John Miller
3d3503289f Try to make ein:company-backend loading more robust.
Try, but seem to still be mostly failing. Think this is more a personal setup
issue than something in general but this change should, at the very least, not
do any harm.
2018-09-28 11:51:57 -05:00
dickmao
ec28cbe708 revive tkf tests
`make test-unit`
`make test-int` (formerly `cask exec ert-runner`)
An intermittent travis-melpa issue is solved by gonewest818.
2018-09-27 00:52:00 -04:00
John Miller
b94a8cf0d3 Update documentation.
Preparing for version bump.
2018-09-18 22:05:44 -05:00
John Miller
a3482660a2 Support eldoc.
Really basic support for eldoc, buidling off the oinfo cache code written to
support function annotations for the ein company backend. In theory should also
work the other completion backends, but untested at the moment.
2018-09-18 21:48:07 -05:00
John Miller
8adc38ae8f Code cleanup.
Get rid of some unused variable warnings, add some lexical-binding definitions
and update some documentation.
2018-09-18 21:46:35 -05:00
John Miller
1122c88e0d Merge branch 'master' of github.com:millejoh/emacs-ipython-notebook 2018-09-09 09:51:52 -05:00
John Miller
4d9c05f2dc Maybe fix for #334
ein wasn't using the correct protocol for "inspect_request" messages for recent
versions (>5.0) of the protocol.
2018-09-09 09:44:59 -05:00
Sam Steingold
143267cf06 add ein:worksheet-kernel-status 2018-09-05 09:50:12 -04:00
Sam Steingold
f2396e6ebe simplify code 2018-09-05 09:50:12 -04:00
Sam Steingold
0cc585f7f2 remove a spurious "}" in help 2018-09-05 09:50:12 -04:00
Sam Steingold
bdcfa149ab untabify and fix indentation 2018-09-05 09:50:12 -04:00
Sam Steingold
5cb717a9c2 fix typos in the last patch 2018-09-04 10:35:35 -04:00
John Miller
7320c16b47 ein-company: Function annotations via oinfo db
As ein builds completions for company it will build a database of object-info
data that can later be used for function annotations.
2018-09-03 16:06:15 -05:00
John Miller
8b7f26d668 Refactor object info for company annotations. 2018-09-02 23:24:21 -05:00
Sam Steingold
691938ee81 ein:console-executable-get: fail if console executable was not found 2018-08-30 16:38:07 -04:00
John Miller
c648424389 Fix #297.
Raise an error if the user does not specify the port or the full URL when
calling functions like `ein:notebooklist-open' and `ein:notebooklist-login'.

It can be debated that ein should assume http over https if the user doesn't
specify, but I currently think it shouldn't. Debate me.
2018-08-29 17:32:09 -05:00
John Miller
532a92aa49 Fix for #328. 2018-08-29 15:27:03 -05:00
Tomasz Mieszkowski
c7d77ec2f5 Fix for bumping gc-cons-threshold while opening notebooks
Make `ein:gc-prepare-operation` idempotent and add missing call to
`ein:gc-complete-operation` - without it, each subsequently opened notebook
bumps gc threshold to a higher and higher value, effectively disabling all
garbage collection and seriously degrading overall performance.
2018-08-25 21:10:19 +02:00
John Miller
1110649244 Merge branch 'master' of github.com:millejoh/emacs-ipython-notebook 2018-08-25 13:26:11 -05:00
John Miller
91d78370d3 EIN, Company, Jedi, and connected buffers
Not sure if it is really doing anything, but ein:use-company-jedi-backend is now
a valid setting for ein:completion-backends.

More useful is that connected buffers now use ein's company completeion backend,
so completion should now work across all backends all across ein. Now let's get
something working in org!
2018-08-25 13:41:09 -04:00
John Miller
c65c21403e Improving ein-company
Code for getting matches uses deferred and calls to `ein:completer-complete',
avoiding the hacks needed with `ein:completer-finish-completing-company' (names
are shorter too!). Using deferred makes reading the code a bit easier, I think.

EIN will also try to prepare function annotations via the python oinfo object.
Performance is not ideal when the completion candidate list is long, so there is
a new customizable variable `ein:allow-company-annotations' to control this
behavior.
2018-08-25 12:45:50 -04:00
John Miller
658787dfc1 Some utility functions in case we ever try to implement capf.
Some functions to find the beginning and ending positions of the python symbol
at point - we might need this if we ever try to implement support for
capf (completion at point function).
2018-08-25 12:25:05 -04:00
John Miller
d117ce915f Fix for #325
EIN's complete_request wasn't using the correct parameter for recent (> 5.0)
of the jupyter messaging protocol.
2018-08-16 08:43:25 -05:00
John Miller
66f65eefec Merge branch 'master' of github.com:millejoh/emacs-ipython-notebook 2018-08-09 09:16:02 -05:00
John Miller
926055e5fb Fix for #317.
Python JSON keywords use underscores - I am too use to the lisp way which uses
dashes.
2018-08-07 08:36:26 -05:00
Tomasz Mieszkowski
f29f0a3293 Don't strip existing headers in ein:query-prepare-header
This change fixes the issue where notebook being saved is sent to Jupyter with
`Content-Type: application/x-www-form-urlencoded`, because the default value of
this header (`application/json`) gets wiped out in `ein:query-prepare-header`.

The above issue becomes more apparent when notebook contains non-ascii
characters - in such case Jupyter logs a warning: `Invalid x-www-form-urlencoded
body: 'latin-1' codec can't encode characters in position XXX: ordinal not in
range(256)`.
2018-06-24 17:54:20 +02:00
John Miller
d9dc2f34c4
Merge pull request #314 from JackCrawley/patch-1
Fix `ein:object-at-point' in `subword-mode'
2018-06-12 06:32:28 -05:00
John Miller
7779d281e6 Quote argument to %run, handle notebooks with no kernelspec.
Bug fixes, both.
2018-06-12 06:29:08 -05:00
John Miller
81072a537f ob-ein: Execute hy code from org mode source blocks.
New source block ein-hy that will execute hy code if your python kernel has
hylang installed.
2018-06-09 11:59:42 -05:00
Jack
78c981597d
Fix ein:object-at-point' in subword-mode'
This fixes the `ein:object-at-point' function so it works in `subword-mode'. 

Original issue here:

https://github.com/millejoh/emacs-ipython-notebook/issues/313

-------------------------------------------------------------------------

When `subword-mode` is enabled, the `(ein:object-at-point)` function fails after dots. For example, let's say `|` is the cursor and `subword-mode` is enabled: 

Calling `(ein:object-at-point)` on this: `tf|` returns `"tf"`. This is correct.

Calling `(ein:object-at-point)` on this: `tf.|` returns `nil`. It should return `"tf."`.

Calling `(ein:object-at-point)` on this: `tf.nn|` returns `nil`. It should return `"tf.nn"`.

One side effect of this is that `company-mode` suggestions stop working after dots in `subword-mode`. For example:

```
import tensorflow as tf
tf.n|
```

Will not provide suggestions from the ein completion engine. 

I tried changing the `(ein:object-at-point)` function to return the *symbol* at point, rather than the word, and this fixed the problem. Would this produce any undesirable side effects? If not, I can submit a pull request.
2018-06-05 14:57:53 -07:00
John Miller
8a91febf88 ob-ein: Allow code execution while in an edit buffer
Via the function `org-babel-edit:ein-execute' which s bound to `C-c C-c` by
default.
2018-06-04 08:10:50 -05:00
Sam Steingold
9cb9dd7345 now that auto-complete is an official dependency, we can require it unconditionally
this allows us to get rid of the ugly eval on a macro
2018-05-31 19:55:45 -04:00
John Miller
895777f5ea Try again to fix eager macro expansion error on travis. 2018-05-31 13:15:04 -05:00
John Miller
bea8b7b580 Compiler warning cleanup.
Also try to resolve a bit of the dependency heck that is ein.
2018-05-31 12:44:16 -05:00
John Miller
59d2b83a21 Maybe fix eager macro expansion error on travis. 2018-05-31 07:56:38 -05:00
Sam Steingold
359d4caabc avoid compilation warnings about unused lexicals and fix minor typos 2018-05-29 17:20:54 -04:00
Sam Steingold
3f970319fe every defcustom must have :type 2018-05-29 17:20:31 -04:00
Sam Steingold
b6e6dff7ba avoid unnecessary `eval' 2018-05-29 10:01:25 -04:00
Sam Steingold
58a199e1c6 code cleanup: remove ein:min and ein:do-nothing (ELisp has min and ignore) 2018-05-27 12:04:13 -04:00
Sam Steingold
264f355081 make timestamp format customizable and default to ISO 8601
add ein:format-time-string and use it for both ein:timestamp-format
and ein:notebooklist-date-format
2018-05-25 11:43:39 -04:00
John Miller
6e9fa64bb0 Fix #260.
See new interactive function `ein:notebooklist-refresh-kernelspecs'. Maybe I
will document it by the next commit.
2018-05-20 08:42:42 -05:00
John Miller
f39ff47571 ob-ein: Fix for #300 2018-05-16 16:11:14 -05:00
Adrian Kretz
4bc4e54999 Fix token authentication 2018-05-15 02:24:03 +02:00
John Miller
1e70df87d0 ein-timestamp:
Small change to how metadata is stored so notebook will save without erroring.
2018-05-12 17:50:49 -05:00
John Miller
4e0deb86ae Implementing ExecuteTime in ein.
If you want to try this in your installation of ein then place a call
to (require 'ein-timestamp) in your init file after loading ein.
2018-05-12 17:37:21 -05:00