Commit graph

2331 commits

Author SHA1 Message Date
John Miller
c97c85eae8 ein-cell-output: Remove duplicate code. 2017-05-18 10:17:10 -05:00
John Miller
4b92b3adcc ein-kernel: Support (anew) starting kernels in older versions of jupyter.
Overzealously looking to the future was my sin here.
2017-05-18 09:04:49 -05:00
John Miller
f2b138b4f7 ein-file: Remove unused code. 2017-05-17 20:14:23 -05:00
John Miller
d9c77492d6 Balancing parenthesis. 2017-05-16 15:07:14 -05:00
John Miller
4f4cfa8f0a Ensure new cells have metadata set. 2017-05-16 14:34:40 -05:00
John Miller
43a1afe49b Preserve metadata information when saving.
EIN should now respect when other actors (namely nbextensions) set metadata for
a cell.
2017-05-16 13:55:43 -05:00
John Miller
db07da61d3 ob-ein: Always return full uri's for sessions, even if only port has been given. 2017-04-26 21:09:39 -05:00
John Miller
461e400c9d ob-ein: Handle full uri's in :session argument.
Correctly handle full uri's when they are provided as a :session. Also ob-ein
converts :session arguments that just specify the port into full uri's.
2017-04-26 21:09:39 -05:00
John Miller
3d925ec447 Merge pull request #201 from JosefAssad/199-emacs-version-support
remove mention of emacs 23 and 24 support
2017-04-25 10:48:14 -05:00
Josef Assad
db91f0e641 remove mention of emacs 23 and 24 support 2017-04-25 09:08:17 +02:00
John Miller
5ed0b871ce ein-file.el: handle text encoding on windows
Try to sanely decode text on windows sytems to avoid getting a buffer full of ^M
EOL symbols when opening files through ein's notebooklist buffer.

This doesn't appear to be necessary on Unix systems, and by extension I am going
to assume it is also the same on Mac OS X.
2017-04-21 20:29:19 -05:00
John Miller
5c2f34ceeb Implement company locate command.
ein company backend now dutifully looks for the file and line where an object is
defined when company so asks it. When ein fails in its duty it fails silently
and I am not sure yet if that is the correct behavior. For now it will stand,
until I think of something better.
2017-04-21 19:07:16 -05:00
John Miller
91b5f605ee Implementat company doc-buffer command.
ein company backend will now show results of inspect_request in a company
documentation buffer when company requests documentation via the doc-buffer
command.
2017-04-21 17:57:16 -05:00
John Miller
ab106032a8 Fixing bug in company backend.
The backend was working properly only when completing at the beginning of the
lines. For example, completing `import IPython.` would end up replacing the
import and moving IPython to the beginning of the line. EIN's company backend no
longer does this.
2017-04-20 19:55:00 -05:00
John Miller
3aac45257c Cosmetic tweaks to ein-company.el 2017-04-20 16:33:56 -05:00
John Miller
7ad1faf452 Fix completion issues with ein's company backend.
Also tweak names of buffers for editing non-notebook files.
2017-04-20 16:21:54 -05:00
John Miller
16d5c73d39 Merge branch 'master' into company-async-complete-ng 2017-04-20 07:54:45 -05:00
John Miller
88595dede6 Support filetypes other than ipynb
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.
2017-04-20 07:47:05 -05:00
John Miller
bf1000e62e Merge pull request #196 from sam-s/master
ein:notebook-save-notebook: run before-save-hook in the notebook buffer
2017-04-19 12:50:54 -05:00
Sam Steingold
69e5bbc901 ein:notebook-save-notebook: run before-save-hook in the notebook buffer (fix issue#173) 2017-04-19 13:35:09 -04:00
John Miller
06269b72bb Update autoloads for ein-company.el 2017-04-19 10:57:19 -05:00
John Miller
d13e85b370 Minimally functional company-mode support.
There is now a company mode backend for ein. It generates completions by sending
complete_request to the running kernel so for the moment no jedi integration.

Configuring is maybe non-obvious - user should at minimum set
`ein:use-auto-complete` and `ein:use-auto-complete-superpack` to nil. Adding a
`(require 'ein-company)` probably should be done somewhere in the user's init
file. This could all be done better so I will attempt to address in later
commits.
2017-04-19 10:12:45 -05:00
John Miller
63b064cc33 Merge branch 'company-mode-support' into company-async-complete-ng 2017-04-18 17:49:46 -05:00
John Miller
f0f0c0d206 Typos, more efficient kernelspec querying.
Silly typo in ein-kernel.el. Querying kernelspecs is slightly more efficient,
caching results when url is a string or port (previously just cached results for
ports).
2017-04-11 17:09:30 -05:00
John Miller
7ff2a53598 Add ein-jupyterhub.el
Per popular request, publishing what I have so far for jupyterhub support, which
is not much. But it may server as a starting point for someone smarter than I.
2017-04-07 08:25:37 -05:00
John Miller
39f5d329f1 Functional tests start jupyter using ein:jupyter-server-start
This reduces some of the complexity in testein.py, but unfortunately running
tests is still unreliable. Running batchwise tests don't work at all in Windows,
and running from inside emacs tests often need to be run multiple times before
they pass.

The worst offender is the delete notebook test, which will pass on usually only
1 out of 3 tries.

Testing seems to have revealed a couple bugs, so win??
2017-04-07 08:18:41 -05:00
John Miller
64267aca7d ein:notebookupdate-url-or-port: Allow user to change a notebook's url-or-port
There may be situations when a jupyter server restarts at a new url/port while a
notebook is open. This function allows the user to specify the new url/port and
continue using the notebook (or at the very least, save any changes made while
the server was down and rebooting). EIN will helpfully try to restart the kernel
once the url is changed. Jupyter may complain about session not being found, but
it does not seem to affect the running kernel.
2017-04-03 20:49:51 -05:00
John Miller
d189d8b924 Implement uploads per #170. 2017-04-02 14:33:56 -05:00
John Miller
e88f7f3d5f Fix for #188.
Make even more unique edit-cell buffer names. Check that an edit-cell-buffer
does not already exits before creating one.

Also try to be even more aggressive in limiting output in backtraces when
debugging ein.
2017-04-02 08:59:02 -05:00
John Miller
2547226f2e Merge pull request #186 from cpbotha/cpb-kernel-in-ein-cell-edit
ein:get-kernel works in edit-cell-mode
2017-03-22 08:50:10 -05:00
Charl P. Botha
61ba1e9a30 ein:get-kernel works in edit-cell-mode
Modify ein:get-kernel so it can retrieve the kernel from the local
worksheet variable in edit-cell-mode. This is done so that functions
such as ein:completer-complete and tooltips / inline help are
availeble to be bound by the user.
2017-03-22 12:22:36 +02:00
John Miller
12e522c05f Merge pull request #185 from jschwab/fix-184
Add guard to allow for links in older org-mode versions
2017-03-20 14:22:54 -05:00
Josiah Schwab
68cc6f59b0 Add guard to allow for links in older org-mode versions 2017-03-20 11:26:04 -07:00
John Miller
80fc8b1f7d Fix for #181.
Only enable ein:pager-mode for pager buffers that don't already have the mode
enabled.
2017-03-19 13:19:01 -05:00
John Miller
8cb69fe4e7 Update to latest sessions API
Set POST body during session creation per
http://jupyter-api.surge.sh/#!/sessions/get_sessions.
2017-03-16 22:28:17 -05:00
John Miller
095d758670 Even more cl-generic-ification. 2017-03-16 16:55:10 -05:00
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
0a958b0f36 What is going on? 2017-03-04 21:21:29 -06:00
John Miller
0d328470b3 What a waste of a commit. 2017-03-04 21:07:52 -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
John Miller
4578772ff1 Merge pull request #180 from neuschwanstein/master
Fix for the copy cell feature
2017-02-24 13:15:27 -06:00
Thierry BM
740c1ca999 Fix for the copy cell feature 2017-02-23 19:14:01 -05:00
John Miller
40af5bf381 Merge pull request #179 from sam-s/master
extract ein:pytools-jump-to-source-1 from ein:pytools-jump-to-source
2017-02-23 08:59:14 -06: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