Commit graph

1193 commits

Author SHA1 Message Date
John Miller
b195fbdd70 ein-traceback has been cl-generic-ified. 2017-03-16 16:42:03 -05:00
John Miller
0ea4a9adef Cleaning up compile warnings.
Slowly move towards cl-generic instead of EIEIO.

Got rid of json encoding defadvices. So far so good.
2017-03-16 16:16:16 -05:00
John Miller
fdb20813cf Give another try at company-mode integration. 2017-03-04 21:25:21 -06:00
John Miller
68b2e94a75 Merge branch 'master' into company-mode-support 2017-03-04 21:23:17 -06:00
John Miller
7cff07321a Whitespace cleanup. 2017-03-04 20:57:37 -06:00
John Miller
1d82941c98 Bump versions for dependencies. 2017-02-25 21:40:49 -06:00
Thierry BM
740c1ca999 Fix for the copy cell feature 2017-02-23 19:14:01 -05:00
Sam Steingold
ac74ff8868 extract ein:pytools-jump-to-source-1 from ein:pytools-jump-to-source
Check that `filename` actually exists before jumping to it.
Without this patch M-. on an arbitrary word ZZZ creates two empty buffers,
one named "None" and the other named (yes, this is the actual buffer name):
"code.py:456: UserWarning: Argument given (ZZZ) can't be found as a variable or as a filename."
2017-02-22 11:03:24 -05:00
John Miller
6b7e251658 Allow user to specify additional arguments to start the jupyter server.
See customizable variable `ein:jupyter-server-args'.
2017-02-20 18:07:17 -06:00
John Miller
3fc73b98d8 Attempt at workaround for curl cookie jar issues
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.
2017-02-17 15:06:59 -06:00
John Miller
9e1341a704 Better documentation for a better user experience.
And better jupyter server launching...
2017-02-16 16:57:37 -06:00
John Miller
06fbab9058 Preparing for a version bump. 2017-02-16 09:19:40 -06:00
John Miller
58d8142d0a Numerous documentation updates.
Get rid of ein-sections: you are not yet ready for the world young man!
2017-02-16 09:01:14 -06:00
John Miller
900d7b4375 Add some customiable variables for controlling ein:jupyter-server-start 2017-02-16 08:11:58 -06:00
John Miller
4ccaa9337c Allow keepalive to be automatically enabled.
When the customizable variable `ein:enable-keepalive` is non-nil EIN will
automatically call `ein:notebooklist-enable-keepalive` when calling
`ein:notebooklist-open`. Keepalive has also been tweaked to make sure it does
not create multiple timers.
2017-02-15 19:33:35 -06:00
John Miller
4061a58c94 John discovers M-x update-directory-autoloads
Hope this does what I mean it to do..
2017-02-15 18:58:30 -06:00
John Miller
41f1513ac7 Forgot to specify autoload for the server commands. 2017-02-15 15:06:38 -06:00
John Miller
191d27c3ac Make stopping a jupyter server more user-friendly.
When calling `ein:jupyter-server-stop` ask to user if they are sure and also
give them the option to save any unsaved notebooks before killing the server.

Before closing the server also close any open notebook buffers.
2017-02-15 15:02:07 -06:00
John Miller
05bd6c010b Support for starting and stopping the notebook server from emacs.
For the moment we only support current version of jupyter (i.e. 4.3.1 or
greater).

The special commands are `ein:jupyter-server-start` to start a notebook server
and `ein:jupyter-server-stop` to, clearly, stop a notebook server.

On starting a server EIN will try to determine the url and token for accessing
the notebook server, login and open the notebook list automatically.
2017-02-15 14:18:16 -06:00
John Miller
a4f9128182 Steps towards sections. More stable notebooklist buffers.
Initial steps integrating magit's sections into ein. Also an attempt to make
notebooklist buffers more "stable" by adding a slight pause during session
queries.
2017-02-12 22:09:44 -06:00
John Miller
f5f4d5c04f Merge branch 'master' into matplotlib-inspector 2017-02-09 11:58:31 -06:00
John Miller
faf61c3cc3 Fix bug that was preventing cell edit's from saving.
Bad bug! No pudding for you!
2017-02-09 11:56:51 -06:00
John Miller
0cda822609 Basic prototyping of buffer layout.
Testing out layouts and ability to get object information through json strings.
2017-02-09 11:52:58 -06:00
John Miller
8ec5d4638e Prototyping the object inspector buffer.
Display value of object's __repr__, link to source when available, and
documentation.

Adding command and keybinding (C-ci) to notebook buffer keymap.

Get rid of unnecessary api check when rendering notebooklist buffer.
2017-02-06 20:19:20 -06:00
John Miller
0ede9e7ef6 Typos in slot name accessors, fix version cache to accept URL strings.
Mistyped some accessors for worksheet slot accessors. Correct
`*running-ipython-version*` hash to accept strings (i.e. URL's) as well as just
port numbers.
2017-02-01 09:51:12 -06:00
John Miller
4e482cafd9 Stop being so clever with error handling. Stepping away from eieio.
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.
2017-02-01 09:25:47 -06:00
John Miller
94e334cbf0 Try to keep long running sessions from expiring
The function `ein:notebooklist-enable-keepalive` and
`ein:notebooklist-disable-keepalive`, respectively enable a timer that
ocassionally (on the order of hours) sends a query to the notebook server. The
goal is to keep cookies and sessions from expiring in long running notebooks.
We'll see if it works.
2017-01-31 10:44:04 -06:00
John Miller
2615d77a7f ob-ein's custom header name should be :image, not :images. 2017-01-30 21:34:58 -06:00
John Miller
28ed036d41 Log save hook error warnings to *ein:log-all* instead of *Messages*
Some believe that alerting the user in the *Messages* buffer when there is an
error trying to run the before-save-hooks is overly verbose and a nuisance. EIN
should still warn what is happening, I think, but instead of `warn`ing the
message no goes to the *ein:log-all* buffer.
2017-01-29 11:42:06 -06:00
John Miller
ceec3f8feb Fix missing paren in ein-worksheet.el
Paredit, why have you abandoned me?
2017-01-29 11:12:31 -06:00
John Miller
ac2aa7f88e Better live updating in cell editing buffers, less buggy undo
Saving in a cell editing buffer now actually causes the cell in the worksheet to
be dynamically updated (oh how we have waited for this moment).

Try to get cell undo actions to be less likely to trigger an error.
2017-01-28 11:08:26 -06:00
John Miller
3412470b61 More convenience finding the channels debug buffer
Post Ipython 2.0 there are no longer separate websocket connections for iopub
and shell, they now share the same websocket connect. This is a simple
convenience function for finding the websocket log buffer for the new-style
connection.
2017-01-19 11:27:22 -06:00
John Miller
5c945a174f Document changes to ob-ein. Error when no :image header specified.
ob-ein will alert the user if they are generating an image in the ob-ein source
block and no :image header has been supplied. Added some documentation for good
measure, though people will probably still get tripped up by this.
2017-01-18 10:31:30 -06:00
John Miller
7e222f3ebf ob-ein: better formatting for results.
Return the results of execution as a single string instead of a list of strings.
This allows some more flexibility when dealing with :results parameters and
seems to fix a bug with inserting matplotlib images. Hint: try using `:results
value raw`.
2017-01-18 09:58:37 -06:00
John Miller
b52ccbd46d Version bump, integrate docs into Cask, new doc theme.
Using alabaster for the documentation theme. Building documentation now relies
on having cask present, which does a better job of tracking dependencies than
the old way.
2017-01-17 06:55:44 -06:00
John Miller
e226b30139 Follow redirects, numerous other fixes.
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.
2017-01-11 07:42:06 -06:00
John Miller
f8e78a421e More robust notebook saving, object source.
More graceful handling of errors in before-save-hook. Also improved
pytools find-source.
2017-01-07 15:07:24 -06:00
John Miller
ed9c0cf606 Fix for issue #162.
Add X-XSRFTOKEN header when cookie is present. See notes for notebook
[v4.3.1](https://blog.jupyter.org/2016/12/21/jupyter-notebook-4-3-1/).
2017-01-03 20:11:28 -06:00
John Miller
481d8a879f Smarter ein block execution in org.
Be smarter when detecting if ein source block has finished executing. Also make
timeout user-configurable via the variable `ein:org-execute-timeout`.
2016-12-28 09:41:02 -06:00
John Miller
3cdb353fe2 Merge branch 'master' of github.com:millejoh/emacs-ipython-notebook 2016-12-28 09:36:33 -06:00
Sam Steingold
5d06c91349 autoload ein:notebooklist-login (issue#154) 2016-12-27 12:04:25 -05:00
John Miller
a81aef7386 Source tracking in EIN ipdb sessions.
Slowly recreating functionality available in python-mode.
2016-12-24 12:51:54 -06:00
John Miller
cfd0e8a3d7 Fix clear_output in the Jupyter age and a bug fix.
Finally do the right thing when clear_output is received. Closes issue #24. Also
fix a nasty bug that might occurr when trying to open a notebook with no
associated kernelspec.
2016-12-23 16:33:35 -06:00
John Miller
559b956cfa Jupyter console workaround for windows systems. 2016-12-23 14:40:21 -06:00
John Miller
9468f40bce Better kernelspec display name, pytools only for python kernels.
Prettier kernelspec names in notebooklist buffers. Only load pytools for python
kernels, which hopefully will help with connecting to non-python kernels.
2016-12-22 14:04:51 -06:00
John Miller
06eb2eea2c Cleanup, better error handling, remove request cookie defadvice.
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.
2016-12-22 12:19:52 -06:00
John Miller
1b3aa10d51 Properly detect set_next_input payloads.
With this change %load magic works correctly.
2016-12-18 23:09:07 -06:00
John Miller
45f9b00449 Better macro name, make sure it gets required.
Better name for support macro to temporarily disable undo, add a require to the
code where it is being used.
2016-12-18 22:19:50 -06:00
John Miller
d7ce140487 Merge remote-tracking branch 'refs/remotes/origin/master' into 104-load-magic 2016-12-18 19:29:55 -06:00
John Miller
495d652ee0 Cosmetic updates to code formatting. 2016-12-18 19:27:35 -06:00