Commit graph

1135 commits

Author SHA1 Message Date
Edward Banner
3564ef3196 Add no-popup to lexical-let
I don't know enough about lexical-let to know why this works.
2018-03-29 11:15:35 -07:00
Edward Banner
e17819f918 Add no-popup option to ein:jupyter-server-start 2018-03-26 19:54:34 -07:00
John Miller
115c16eb9f ein-hy: Support executing hy code from notebook running a python kernel.
It's magic! If you have hy installed in your environment, you can run code in a
notebook running a python kernel. Just set the cell type to hy-code!
2018-03-11 12:29:54 -05:00
John Miller
73747d86d9 ein-shared-output: Queue up requests ala deferred:$
Try to gracefully handle multiple calls to `ein:shared-output-eval-string' by
wrapping calls to deferred:$. The deferred chain will not call
`ein:cell-execute' if the cell is already running.

Also did a bit of refactoring in ob-ein.
2018-03-10 07:53:49 -06:00
John Miller
a8fc712ca8 ob-ein: Wrap if-let* var list properly.
Make async work a little better, but can still have problems if one tries to
execute several source blocks at once.
2018-03-10 07:07:37 -06:00
John Miller
baec3d8577 ein-notebooklist: Fix #278. 2018-03-08 14:08:45 -06:00
John Miller
4ce1a31793 ein-cell: Fix for #268.
User can now ask ein to truncate long outputs in a worksheet. Use the
customizable variable `ein:truncate-long-cell-output' to control this behavior.
Set to nil to have no truncation, otherwise an integer value specifying the
number of lines to keep before truncating.
2018-03-08 13:36:09 -06:00
John Miller
607e73a125 Merge branch 'master' of github.com:millejoh/emacs-ipython-notebook 2018-03-08 09:09:11 -06:00
John Miller
af45786726 ob-ein: Enable asynchronous execution of source blocks.
Can be enabled or disabled via `ein:org-async-p'.

Greatly inspired by ob-ipython-async and scimax (see the source code, Luke!).
2018-03-08 09:07:31 -06:00
John Miller
7a4d58ea36 ein-notebook: Try to suspend GC operations when loading notebooks.
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.
2018-03-08 09:03:09 -06:00
Miller
710a5a6b91 ein-kernel: Handle generic stdin channel requests
That is, stdin requests that are generated by calls to `input' in Python (and
whatever is equivalent in other kernels).
2018-03-05 15:56:16 -06:00
John Miller
9083cfc891 ein-traceback: Maybe use tramp to find remote files.
In tracebacks, we detect if ein is connected to a remote host, and if so try to
create a TRAMP friendly path when jumping to files from a traceback.

In response to #263.
2018-02-28 06:32:14 -06:00
John Miller
acb79501f0 ein-notebook: Fix ein:get-kernelspec when name is "default"
Passing "default" to `ein:get-kernelspec' would cause it to return a string
naming the actual kernelspec, which just won't do. So we look for that case and
then look for the real kernelspec.
2018-02-27 16:08:46 -06:00
John Miller
073850635a Merge branch 'master' of github.com:millejoh/emacs-ipython-notebook 2018-02-27 14:40:00 -06:00
John Miller
9d5309af59 Trying something new with testing.
Let's do this with ert-runner instead of python. Maybe it will work for once.
2018-02-27 14:38:13 -06:00
Konrad Hinsen
9217994839
Add a comment giving credit to @jkitchin's work 2018-02-27 09:32:51 +01:00
John Miller
e9f7274ebf Merge branch 'master' of git://github.com/ebanner/emacs-ipython-notebook into ebanner-master 2018-02-26 06:16:56 -06:00
John Miller
d549896e44 Merge branch 'master' of github.com:millejoh/emacs-ipython-notebook 2018-02-25 12:47:28 -06:00
John Miller
2ebb039e82 ob-ein: Make :image header argument optional.
Inspired by @khinsen's ob-ipython-async, automatically generate filenames for
inline images. That is, make :image an optional argument for ein source blocks
in org.
2018-02-25 12:43:12 -06:00
John Miller
99b869c228 ein-kernelinfo: Structure for language agnostic info queries
EIN historically used a call to python getcwd and gethostname to get information
about the currently running kernel. This won't work with non-python kernels, so
I this is an initial attempt to abstract out the call and make it language
agnostic. Still only works in Python, but at least should not cause errors with
other languages.
2018-02-25 12:39:11 -06:00
Benda Xu
07f1e00761 lisp/ein-cell-edit.el: support R in cell editing. 2018-02-25 09:27:29 +09:00
Edward Banner
dee66e2e00 Search backward instead of forward for connection info 2018-02-21 16:13:11 -08:00
John Miller
c47587243b Merge branch 'master' of github.com:millejoh/emacs-ipython-notebook 2018-02-14 18:26:47 -06:00
John Miller
2fec7cb20e Make kernelinfo language agnostic.
Or at least don't try to call Python code when the kernel language is not
Python.
2018-02-14 18:25:23 -06:00
John Miller
045d9e9a89 Adjustments to debug logging.
Added some verbosity, removed some calls that were causing errors.
2018-02-14 18:24:20 -06:00
John Miller
b130d4b3fe
Merge pull request #270 from sam-s/master
Narrow to cell when indenting code (fix bug#269)
2018-02-14 16:42:07 -06:00
Sam Steingold
32351e0cf3 Narrow to cell when indenting code (fix bug#269)
(ein:narrow-to-cell, ein:python-indent-line-function)
(ein:python-indent-region): New functions.
(ein:ml-lang-setup-python): Set
 `indent-line-function` to `ein:python-indent-line-function` and
 `indent-region-function` to `ein:python-indent-region`.
2018-02-14 11:11:26 -05:00
Matt Burbidge
12fad4d402
require ein-contents-api in ein-jupyterhub 2018-02-09 14:39:29 -07:00
John Miller
7569ab3f19 ein-cell: Maybe fix #264
This seems to fix the formatting issue reported in issue #264. So far the change
has not caused notebook data to become corrupted.
2018-01-24 17:01:48 -06:00
John Miller
63388e5d0c ein-worksheet: Make full undo an optional feature.
Full undo support, including undoing cell actions, is still unstable and can
cause corruption of worksheet data so I am making this an optional feature. See
the variable `ein:worksheet-enable-undo', which by default will be set to nil.
2018-01-24 16:35:41 -06:00
John M. Miller
2f722a31a2 ein-notebooklist: Fix for #260.
Force a query of available kernelspecs when calling `ein:notebooklist-open'.
Idea is to catch when user installs a new kernelspecs while ein is active.
2018-01-10 09:36:27 -06:00
John M. Miller
f771ae9504 ein-traceback: Allow opening tracback buffers from org buffers.
No default keybinding, but one can now call `ein:tb-show' from an org
buffer using ein source code blocks when one of the blocks generates a
traceback.
2018-01-10 09:14:58 -06:00
John M. Miller
a3511de228 ein-core: Continue efforts to make version checking more robust.
Also ensure that old byte-compiled files are deleted when rebuilding ein via
`ein:byte-compile-ein'.
2018-01-10 09:13:33 -06:00
John Miller
1bd6155005 Fix for #253.
Use `executable-find' to expand jupyter server command.
2017-11-28 07:16:20 -06:00
John Miller
27be0fd4c3 Merge branch 'master' of git://github.com/galeo/emacs-ipython-notebook into galeo-master 2017-11-22 22:54:21 -06:00
John Miller
dd0c0bfc52 ein-python: Fix for #252
EIN should properly handle indentation in the worksheet as it once did long ago.
Issues was that python mode no longer uses the global variables
`python-ident-levels' for tracking ident. Now we advise around
`python-indent--calculate-indentation'. This is an internal function so may not
be the best call, but it works.

If it breaks maybe take a look at advising `python-ident-calculate-indentation'.
2017-11-18 11:24:24 -06:00
Moogen Tian
71536bd748 ein-jupyter: Avoid always locating jupyter server startup command
Instead of always prompting the user for the path to the jupyter
executable, it will try to use the value of `*ein:last-jupyter-command*' or
the value of the customizable variable `ein:jupyter-default-server-command'
when the `ein:jupyter-server-start` command is called without C-u prefix arg.
2017-11-16 15:31:41 +08:00
John Miller
f63451ca03 ein-notebooklist: Improved ein:notebook-update-url-or-port.
As well as going to a non-deferred implementation for
`ein:notebooklist-change-url-port' the code now properly restarts the nb kernel
when changing the server the notebook is running on.

Also a small change to the formatting of the notebooklist buffer.
2017-11-07 15:14:45 -06:00
John Miller
ebbf7da36d ob-ein: More stable when starting sessions.
Still not 100%, but ob-ein behaves slightly better when trying to connect to a
notebook that is not currently open.
2017-11-07 15:13:23 -06:00
John Miller
a03eee4cd7 ein-jupyter: More timeout adjustments. 2017-11-04 11:27:31 -05:00
John Miller
c5421b090f More eieio warning cleanup. 2017-11-04 11:27:06 -05:00
John Miller
eaded1e013 ein-kernelinfo: Warning cleanup. 2017-10-24 12:43:03 -05:00
John Miller
5f61a7fd09 ein-shared-output: Warning cleanup. 2017-10-24 12:42:41 -05:00
John Miller
58e29ea774 ein-events: Clean byte compile warnings. 2017-10-24 12:14:20 -05:00
John Miller
af13e8cdb1 ein-worksheet: Clean byte-compile warnings. 2017-10-24 12:12:50 -05:00
John Miller
7e722763ce ein-notification: Clean up byte-compile warnings. 2017-10-24 12:10:56 -05:00
John Miller
a20562e1fc Prepare for version bump. 2017-10-24 11:03:50 -05:00
John Miller
08a021781f ein-jupyter: We really need accept-process-output on Windows. 2017-10-23 19:40:06 -05:00
John Miller
9c2e6fe7c8 ein-company: Only check for punctation near completion point.
This will allow ein-company backend to complete in the middle of a line.
2017-10-23 19:39:00 -05:00
John Miller
3fa575bbf4 ein-company: Tweak punctation check.
Spaces should also not trigger completion.
2017-10-22 19:20:41 -05:00