Commit graph

68 commits

Author SHA1 Message Date
John Miller
70845a3411
Use completing-read instead of ido-completing-read. (#514)
* Use completing-read instead of ido-completing-read.

Per @seagle0128 and issue #496.

* lisp/ein-notebook.el:

* Wrap all calls to completing-read with ein:completing-read

Use `ein:completing-read' everywhere we need to do completion as it wraps Emacs
completing-read functionality and tries to use sane defaults.
2019-04-16 10:04:11 -05:00
dickmao
234cf391f9 Polymode
M-x customize-group RET ein
Toggle Ein:Polymode

Avoid trying to emulate jump-to-definition, eldoc, and autocompletion
functionalities that Elpy will always do better.

Fixes #497 #482 #418
2019-04-02 09:35:17 -04:00
John Miller
94655e7738 ein-company: Implement company completion in connected buffers. 2019-02-26 08:55:17 -06:00
dickmao
ed6482096e Add ob-ein tests
Also, speed up login and other cleanups
2019-02-19 10:06:15 -05:00
dickmao
129afa5fb4 Respect cursor_start and cursor_end in matches
The :cursor_start and :cursor_end fields tell us whether we need to
prepend the prefix ourselves.

Fixes #436
2018-12-28 21:14:11 -05:00
dickmao
d4ef4ed81c Allow disabling of autocomplete
```
M-x customize-group RET ein-completion
```
Set `Ein:Completion Backend` to `ein:use-none-backend`, Set `State` to
`Save for Future Sessions`.

Also use `featurep` and `with-eval-after-load` to clean up the
subpackage requiring gymnastics.
2018-11-28 17:45:23 -05: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
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
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
dickmao
bc10cea743 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-12 21:55:33 -05:00
John Miller
3c84bc2ff5 Fix for #347. 2018-10-12 10:34:04 -05: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
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
7779d281e6 Quote argument to %run, handle notebooks with no kernelspec.
Bug fixes, both.
2018-06-12 06:29:08 -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
c35b4f80f7 ein-connect: Fix for #287.
Defer the deferred...

A bit less cryptically - wrap call to ein:shared-output-eval-string in a
deferred construct to ensure proper sequential execution of autoexec cells.
2018-04-04 20:13:26 -05:00
John Miller
e0e3fac0c4 ein-connect: Missed a couple oref's. 2017-10-03 10:17:47 -05:00
John Miller
c0eabfe2ad ein-notebooklist: Fix possible bug specifying notebook urls
Don't think we were handling https:// url's correctly.

Also some code cleanup in ein-connect; fix longstanding bug in ein:load-files,
and tweak default timeout for starting a jupyter session from within emacs.
2017-10-03 10:04:41 -05:00
John Miller
1ab98b0c9d ein-jupyter: More stable ein:jupyter-server-start
Trying to increase reliability of starting a juptyer server from Emacs. Deferred
is cool, but a pain to understand for this old brain.

Fix some typos in ein-ob and be smarter selecting completion backend when
connecting a python buffer to a jupyter notebook.
2017-09-22 14:31:14 -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
Takafumi Arakaki
a1ddf7a7a9 Rename: ein-cached -> ein-async 2013-07-10 21:14:58 +02:00
Takafumi Arakaki
85e020bb8d Do not record ein:connect-eval-buffer to IPython history 2012-11-03 22:18:06 +01:00
Takafumi Arakaki
40f9bf0d2e Do not record run-buffer commands to IPython history 2012-11-03 22:12:17 +01:00
Takafumi Arakaki
5126a2f0b4 Do not turn off ein:connect-mode by revert-buffer 2012-09-29 22:21:48 +02:00
Takafumi Arakaki
4c94006516 Set buffer properly in ein:connect-buffer-to-notebook
Current buffer must be set when accessing ein:%connect% and
ac-sources.
2012-09-11 00:49:40 +02:00
Takafumi Arakaki
6f1a11be30 Add autoload cookies 2012-09-01 20:51:55 +02:00
Takafumi Arakaki
df449b3350 Scratchsheet can be opened from connected buffer now 2012-08-31 17:21:19 +02:00
Takafumi Arakaki
ca8c1678fe (require 'ein-utils) -> (require 'ein-core) 2012-08-28 15:26:32 +02:00
Takafumi Arakaki
21009827e2 Add ein:notebooklist-load 2012-08-26 22:15:44 +02:00
Takafumi Arakaki
32f6aaba6d Simplify ein:connect-to-default-notebook
... by modifying ein:pytools-jump-to-source a bit.
2012-08-26 21:50:05 +02:00
Takafumi Arakaki
f8fba2d140 Document ein:connect-default-notebook more 2012-08-26 21:42:25 +02:00
Takafumi Arakaki
0fb3f9ea3e Add ein:connect-to-default-notebook 2012-08-26 21:38:18 +02:00
Takafumi Arakaki
6b859c4caa Fix ein:connect-run-buffer (tramp support) 2012-08-22 18:05:19 +02:00
Takafumi Arakaki
837dea249a Check if notebook is live in ein:connect-pop-to-notebook
This is important as `(pop-to-buffer nil)' actually works.
2012-08-21 15:48:44 +02:00
Takafumi Arakaki
d8aaa079ae Support more arguments in ein:connect-to-notebook 2012-08-21 15:36:22 +02:00
Takafumi Arakaki
21981de22f Document ein:connect-toggle-autoexec more 2012-08-21 09:26:28 +02:00
Takafumi Arakaki
37ab6ba028 Auto-execute on run/eval, not save
It is pointless to execute code in notebook unless some change in
the connected buffer is imported into the IPython kernel.  Therefore,
hooking auto-execution to run or eval makes more sense than hooking
it to save.
2012-08-21 09:13:12 +02:00
Takafumi Arakaki
157ddfa31a Fix ein:notebook-execute-autoexec-cells 2012-08-20 11:55:00 +02:00
Takafumi Arakaki
c55e4c83c0 Move completion functions to ein-completer.el
Unify functions in ein-notebook.el and ein-connect.el.
2012-08-19 23:04:00 +02:00
Takafumi Arakaki
f32a169920 Move tooltip and help command to pytools
ein-notebook.el and ein-connect.el can share same command thanks to
the generic getter function.
2012-08-19 21:48:28 +02:00
Takafumi Arakaki
26a6dfe6ff Fix: ein:notebook is referenced 2012-08-19 04:34:47 +02:00
Takafumi Arakaki
63d234cd82 Rename class: %s/$connect/connect/g 2012-08-19 00:24:18 +02:00
Takafumi Arakaki
281d09a5f5 Rename: ein:@connect -> ein:%connect%
%s/\_<ein:@\(connect\)\_>/ein:%\1%/g

Define obsolete alias, as user might use this variable.
2012-08-18 23:03:07 +02:00
Takafumi Arakaki
6e6c0c65f3 Rename ein:notebook-console-security-dir in docstring 2012-08-16 16:40:27 +02:00
Takafumi Arakaki
a75d6ede3c Add ein:console-open in ein:connect-mode-map 2012-08-16 16:32:57 +02:00
Takafumi Arakaki
5d159f3f87 Add ein:connect-reload-buffer 2012-08-16 03:43:14 +02:00
Takafumi Arakaki
31216cb370 Fix compiler warning in ein:get-traceback-data--connect 2012-08-16 01:59:24 +02:00
Takafumi Arakaki
ee1557913b Replace ein:connect-eval-string
with ein:shared-output-eval-string
2012-08-16 01:59:22 +02:00
Takafumi Arakaki
3f8f995910 Provide ein:tb-show in connect/shared-output 2012-08-14 21:11:18 +02:00
Takafumi Arakaki
2faeb54475 Add ein:get-traceback-data generic getter 2012-08-14 21:05:12 +02:00