Commit graph

1485 commits

Author SHA1 Message Date
John Miller
b2d1acc9d5 Issue #644: Add multilang support for xeus-cling
Multilang support for c, c++11, c++14, and c++17. Org babel source blocks are
also support.

Dropping (for a moment) testing against python27 on travis.
2020-01-24 11:16:56 -07:00
John Miller
ae85045d85 Setup multilang hy more like how hy-mode does it.
Also try to work around travis's inexplicable failures with emacs 25.1
2020-01-14 13:51:31 -07:00
John Miller
5496d0d0ec Add multilang support for hy.
Maybe I should write a macro.
2020-01-13 16:31:46 -07:00
John Miller
41d8e61df6 Make travis happy.
Get rid of byte-compile errors, add haskell-mode to development dependencies.
2020-01-04 09:09:41 -07:00
John Miller
c71075328c Correctly process ansi color codes in text output. Multilang haskell.
Caught this while testing julia support.

Bonus change: add multilang support for Haskell.
2020-01-04 09:09:41 -07:00
John Miller
18d329eaad Execute oinfo requests only when kernel is python.
Otherwise we will try to execute python code in a non-python environment. This
doesn't break anythng, but can fill the log with many, many errors.

In the future might be interesting to add language-dependent methods of
generating object information.
2019-12-30 07:14:31 -07:00
John Miller
728ee7c191 Raise undo jigger errors only when debugging is enabled. 2019-12-29 16:06:24 -07:00
John Miller
55a522c806 Imenu items can now include markdown cells that look like headings. 2019-12-29 16:06:24 -07:00
noonker@pm.me
d48edc71b6 Forgot to remove macro variable 2019-12-16 11:49:24 -07:00
Joshua Person
d5d2cab74f Fixed issue where redirect checker was clobbering url 2019-12-16 11:49:24 -07:00
Sam Steingold
6d0d5898b4 extract ein:jupyter-notebook-list
... from ein:crib-token, ein:crib-running-servers, ein:process-refresh-processes
2019-12-12 17:02:23 -07:00
John Miller
738e50fb1a Better make all the calls to length on buffer-undo-list safe. 2019-12-07 17:33:47 -07:00
John Miller
f36ae22b48 buffer-undo-list can become a dotted list in certain situations.
Unsure what those situations are, but when it happens it breakes ein's undo
facility. Calling `length' on a dotted list will generate wrong-argument-type
errors. To help soften the consequences of those situations we call `safe-length'
instead of `length'.
2019-12-07 17:33:47 -07:00
John Miller
aefa088010 Why define a variable if we aren't going to use it?
Modifying ein:%which-cell% when the cell hasn't changed can lead to an obscure
error.

Also, probably unnecessary, but make sure buffer-undo-list is not t (which is a
valid value for this variable) when unshifting.
2019-12-07 17:33:47 -07:00
John Miller
2637898215 Fix spelling (freudian?) error. 2019-12-01 11:31:00 -07:00
John Miller
d9866649e2 Unbreak pytools tooltip code. 2019-12-01 11:31:00 -07:00
John Miller
5224031fcc Split large oinfo requests into smaller chunks. 2019-12-01 11:31:00 -07:00
John Miller
193c25b4ce Reduce the number of oinfo calls.
Notebook performance would noticeably suffer when doing completions in large
namespaces (I'm looking at you pandas) because it could result in many (100's)
of individual calls to `__ein_print_object_info_for'. This was very inefficient,
so now what the code does is make a single python call to generate oinfo results
for a list of completion candidates. Performance seems much improved, but only
time will tell if this is just my imagination or not.
2019-12-01 11:31:00 -07:00
John Miller
cccc8a7b11 Only set figure dpi to integer values. 2019-11-28 20:37:51 -07:00
John Miller
7da1f156eb Automate dpi scaling a bit.
You still need to import matplotlib first, but after doing that if you call
`ein:pytools-matplotlib-api-correction' then ein will try to automatically
adjust the figure dpi to something appropriate for the current display. Setting
up the appropriate hooks to get all this to happen automatically upon opening a
notebook is left as an exercise to the user.
2019-11-28 20:37:51 -07:00
John Miller
b82bf127f8 New commands for setting matplotlib configuration.
See new functions `ein:pytools-set-figure-dpi',
`ein:pytools-set-matplotlib-parameter'. Added some tests as well.
2019-11-28 20:37:51 -07:00
John Miller
f76edbbf42
Better consistency with kernel connections in anonymous ob-ein blocks. (#624)
* Better consistency with kernel connections in anonymous ob-ein blocks.

And some tests to try to prove this is the case.

* Make sure company-mode is enabled.

* Undo cursor shifts.

* Company mode still not catching.

* Travis unhappy with undo and anonymous completion.

Tests work locally, but fail on travis. Let's play around a bit.

* Revert undo position jiggers.

I think the issue is character or line ending encoding in WSL (i.e. Windows) and
a "normal" Linux setup.
2019-11-27 08:59:52 -07:00
Sam Steingold
0a5b663d23 add ein:exit as an alias to ein:quit and make both autoloaded 2019-11-25 10:14:50 -05:00
Sam Steingold
4afa698c9c ein:quit: call ein:jupyter-server-stop only if it is already present 2019-11-25 10:11:15 -05:00
Sam Steingold
3f275425fd add ein:quit to easily exit EIN without killing Emacs 2019-11-18 10:43:04 -05:00
John Miller
6aca94c21b
Merge branch 'master' into pdenno-clojure 2019-11-17 12:30:58 -06:00
John Miller
c8e769183f
Merge pull request #619 from zfc09/file-delete
Implement NBList delete file command.
2019-11-14 22:30:20 -06:00
Zeng, Fucen
c2b14d5f26 Implement NBList delete file command. 2019-11-14 17:14:32 +08:00
Sam Steingold
14ba9121d7 trivial cosmetic changes
(ein:notebook-toggle-latex-fragment): avoid compile warning by declaring px-preview
(ein:notebook-restart-session-command): more verbose confirmation question
(ein:notebook-worksheet-delete): squash nested when/unless
2019-11-13 12:44:35 -05:00
John Miller
143b6e3a93
Merge pull request #611 from millejoh/better-completion
ein-completer: Use entire cell/buffer for completion context.
2019-11-13 06:11:05 -07:00
Tomasz Mieszkowski
9b1d9876bd Add commands to execute all cells above/below current one 2019-11-10 15:40:32 +01:00
Miller
56217bd4ab ein-ipdb: Convenience function to launch ipdb debugger. 2019-11-06 16:38:30 -07:00
John Miller
3aa68f2a00 ein-completer: Use entire cell/buffer for completion context.
The modern Jupyter messaging spec (> 5.0) simplified `complete_request` to allow
sending blocks of text as completion context. EIN now takes advantage of this by
sending the entire contents of the worksheet cell, when in a notebook buffer,
or, when in a non-notebook buffer, the entire contents of the buffer. This
allows backends like jedi to do better context-sensitive completion without
having to execute code. In general this should improve completion behavior,
though may result in an initial performance hit when working in large buffers
while EIN builds the oinfo cache. Note that oinfo (i.e., function call
signatures) will not be available until code in the buffer/cell is executed.
2019-11-04 19:36:24 -07:00
John Miller
91b7375dbf
Issue 608 jedi completion (#609)
* ein-ac: Fail silently for unexpected ein:completion-backend values.

Fixes #608, though we really need a test cases for completion in polymode.

* Only define ein ac-sources when the user explicitly sets the backend.

* Test case for issue #608.

* Only test jedi completion when testing polymode.

* Add epc dependency for emacs-jedi.

* Flanging up with travis is always a challenge.

* Forgot to update the scenario.

* Give jedi time to install.

* Add virtualenv to travis OS X build.

Also add some addition TOX environments for future testing cases.

* OS X travis is failing - is it a timeout issue?
2019-10-28 20:28:37 -06:00
Sam Steingold
c477407500 fix bug #606: defvar for variables defined in ein-jupyter which is not required here 2019-10-26 19:39:25 -06:00
Sam Steingold
7b96d74115 defsubst must be defined before its first use 2019-10-26 19:39:25 -06:00
John Miller
4c923f9a1f Update required version of websocket. 2019-10-20 13:34:51 -06:00
John Miller
86c034997e Rework loop to avoid warning about unused lexical variable. 2019-10-12 08:37:46 -05:00
John Miller
940387b17b Use correct add-function syntax with lexical variables. 2019-10-12 08:37:46 -05:00
John Miller
21693f9b08 Clean-up unused lexical variable warnings. 2019-10-12 08:37:46 -05:00
Sam Steingold
448e161068 Avoid dependency on the deprecated package "cl"
Replace `defun*' with `cl-defun', `loop' with `cl-loop',
  `case' with `cl-case', `assert' with `cl-assert',
  `destructuring-bind' with `cl-destructuring-bind',
  `multiple-value-bind' with `cl-multiple-value-bind',
  `equalp` with `cl-equalp`, `defstruct' with `cl-defstruct`
  &c &c &c
Use lexical-binding instead of lexical-let.
Add declarations and defvar to avoid breakage.
2019-10-12 08:37:46 -05:00
Miller
e7815780d5 Include IPython magics in the syntax table.
The % character should be part of the symbol, just as _ as . are.
2019-10-06 18:05:36 -05:00
Miller
58db03836c company-backends is a buffer-local variable
We have to be careful about setting it globally because that seems to be causing
some conflicts, better to set it at the buffer level when we are opening a
notebook otherwise ein:company-backend may not be activated.
2019-10-06 18:05:36 -05:00
Miller
d3591e011a Improvements to company backend.
- Make sure we only cache actual python objects.
- Do better when we are completing in the middle of an object.

To that end is the new function `ein:object-prefix-at-point' that returns the
prefix for the dotty.thing.at.point. See the function documentation for more
info.
2019-10-06 18:05:36 -05:00
John Miller
ef92e574b2 Support julia in multilang.
Doesn't break travis, but it is causing problems in my local linux setup.
2019-10-05 22:15:39 -05:00
dickmao
b3179a12d1 ein:notebooklist cannot see ein:jupyter-default-server-command on startup.
move default-kernel defcustom to ein:jupyter
2019-09-30 18:36:01 -04:00
dickmao
ed4522b787 ob-lang cannot require org
Generally, ob-lang modules cannot require org, else it gets into
infinite require loop.

This begs the question whether ob-ein is really used by anyone.
2019-09-29 17:16:25 -04:00
dickmao
507eaf4d9a fix NPE in poly-ein (revealed in ESS) 2019-09-29 12:19:46 -04:00
dickmao
189b89fb6c give purcell/nix-emacs-ci a spin 2019-09-29 12:19:36 -04:00
dickmao
e4e04fdc3d Specifying default kernel
```
M-x customize-group RET ein
Select Ein:Notebooklist-Default-Kernel
```

Closes #82
2019-09-29 12:19:10 -04:00